Пт ноя 24, 2017 16:13:12
String msg;
while (Serial.available() > 0) {
byte inChar = Serial.read();
msg += inChar;
}
Serial.println(msg);
Пт ноя 24, 2017 18:04:07
Пн ноя 27, 2017 08:40:21
void setup() {
// start serial port:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop() {
Serial.println( "++++++++++++++++++BEGIN++++++++++++++++");
int i=1;
while (Serial.available() > 0) {
byte inChar = Serial.read();
Serial.print("#"+ String(i)+ ": ");
Serial.println(inChar, HEX);
i=i+1;
delay(5);
}
Serial.println( "________________END_________________");
}
Пн ноя 27, 2017 14:31:08
- Every Message starts with 2 Bytes: 0xB5 0x62
- 1 Byte Class Field follows. The Class defines the basic subset of the message
- 1 Byte ID Field defines the message that is to follow
- 2 Byte Length Field is following. Length is defined as being the length of the payload, only. It does not
include Sync Chars, Length Field, Class, ID or CRC fields. The number format of the length field is an
unsigned 16-Bit integer in Little Endian Format.
- The Payload is a variable length field.
- CK_A and CK_B is a 16 Bit checksum whose calculation is defined below.