-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIF・E220統合 #35
Open
771-8bit
wants to merge
9
commits into
main
Choose a base branch
from
e220_integrate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MIF・E220統合 #35
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
046a3a3
Update Main.ino
771-8bit 611d5d1
add E220-900T22S-JP to CI
771-8bit 6f3781b
e220 integrate
771-8bit 148e56a
Create Ground_E220.ino
771-8bit 25fc68c
Update Pressure.ino
771-8bit 77b4628
Update MissionInterface.ino
771-8bit 17ebbe6
Update MissionInterface.ino
771-8bit 8a7fba4
Update Main.ino
771-8bit 49c0e9c
Update MissionInterface.ino
771-8bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#include <E220.h> | ||
|
||
#define SEND_PERIOD_MS 1000 | ||
|
||
E220 e220(Serial1, 0xFF, 0xFF, 0x0A); //TARGETADRESS=0xFFFF,CHANNEL=0x0A=10ch=ARIB 34-35 | ||
|
||
/*E220configuration | ||
- UARTbaudrate:115200bps | ||
- bandwith: 250kHz//審査書の値なので運営からの指示以外変更禁止 | ||
- channel: 0x0A(ARIB 34-35)//審査書の値なので運営からの指示以外変更禁止 | ||
- target address: 0xFFFF(broradcast) | ||
- power: 13dBm | ||
- SF: TBD | ||
*/ | ||
|
||
/* | ||
------configuration------ | ||
Address(HEX):00 | ||
UARTBaudrate:115200bps | ||
SF:11 | ||
BW:250kHz | ||
SubpacketLength:200bytes | ||
RSSINoise:Not Available | ||
TxPower:0dBm | ||
Channel:10 | ||
RSSIByte:Available | ||
TxMethod:Transparent mode | ||
WORCycle:500ms | ||
------------------------- | ||
*/ | ||
|
||
union unionfloat { | ||
float f; | ||
byte b[4]; | ||
}; | ||
union unionuint32 { | ||
uint32_t i; | ||
byte b[4]; | ||
}; | ||
|
||
|
||
void setup() { | ||
Serial1.setFIFOSize(512); //E220のサブパケ200byteより大きいサイズにする | ||
Serial.begin(115200); | ||
Serial1.begin(115200); //E220のUART | ||
} | ||
|
||
void loop() { | ||
static byte rx_payload[199] = { 0 }; | ||
int rssi = 0; | ||
int Rxlength = 0; | ||
Rxlength = e220.ReceiveDataVariebleLength(rx_payload, 47, &rssi); //surface6_pressureまでの長さ | ||
unionuint32 mcutime_ms; | ||
byte nose_adc_raw[6] = { 0x00 }; | ||
unionfloat nose_temperature; | ||
unionfloat nose_barometic_presure; | ||
unionfloat nose_voltage; | ||
unionfloat surface1_pressure; | ||
unionfloat surface2_pressure; | ||
unionfloat surface3_pressure; | ||
unionfloat surface4_pressure; | ||
unionfloat surface5_pressure; | ||
unionfloat surface6_pressure; | ||
byte status = 0x00; | ||
for (int i = 0; i < 4; i++) { | ||
mcutime_ms.b[i] = rx_payload[i]; | ||
} | ||
status = rx_payload[4]; | ||
for (int i = 0; i < 6; i++) { | ||
nose_adc_raw[i] = rx_payload[i + 5]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
nose_temperature.b[i] = rx_payload[i + 11]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
nose_barometic_presure.b[i] = rx_payload[i + 15]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
nose_voltage.b[i] = rx_payload[i + 19]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface1_pressure.b[i] = rx_payload[i + 23]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface2_pressure.b[i] = rx_payload[i + 27]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface3_pressure.b[i] = rx_payload[i + 31]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface4_pressure.b[i] = rx_payload[i + 35]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface5_pressure.b[i] = rx_payload[i + 39]; | ||
} | ||
for (int i = 0; i < 4; i++) { | ||
surface6_pressure.b[i] = rx_payload[i + 43]; | ||
} | ||
|
||
if (Rxlength > 0) { | ||
Serial.print("RSSI[dBm]:"); | ||
Serial.print(rssi); | ||
Serial.print(",rocket_time_ms:"); | ||
Serial.print(mcutime_ms.i); | ||
Serial.print(",status:"); | ||
StatusSerialPrint(status); | ||
Serial.print(","); | ||
for (int i = 0; i < 6; i++) { | ||
Serial.print(nose_adc_raw[i]); | ||
Serial.print(","); | ||
} | ||
Serial.print(nose_temperature.f, 6); | ||
Serial.print(","); | ||
Serial.print(nose_barometic_presure.f, 6); | ||
Serial.print(","); | ||
Serial.print(nose_voltage.f, 6); | ||
Serial.print(","); | ||
Serial.print(surface1_pressure.f, 6); | ||
Serial.print(","); | ||
Serial.print(surface2_pressure.f, 6); | ||
Serial.print(","); | ||
Serial.print(surface3_pressure.f, 6); | ||
Serial.print(","); | ||
Serial.print(surface4_pressure.f, 6); | ||
Serial.print(","); | ||
Serial.print(surface5_pressure.f, 6); | ||
Serial.print(","); | ||
Serial.println(surface6_pressure.f, 6); | ||
} | ||
} | ||
|
||
void StatusSerialPrint(byte _status) { | ||
for (int i = 0; i < 8; i++) { | ||
if ((_status >> 7 - i) & 0x01) { | ||
Serial.print("1"); | ||
} else { | ||
Serial.print("0"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]