Skip to content

Commit 5fb31af

Browse files
author
harunkurt.me
committed
change name serial_com2Arduino checksums and add Sensors id
1 parent 581d640 commit 5fb31af

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

serial_com1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
# print(val)
3939

4040
value=struct.unpack_from("HHHH",val)
41-
print(value)
41+
# print(value)
4242
if value[3]==25:
4343
print(value[0:3])
4444
elif value[3]==55:
4545
print(value[0:3])
4646
# if value[2]==
4747
else:
48-
49-
print(value[0:3])
48+
print("not true val")
49+
# print(value[0:3])
5050
# print(value)
5151

5252
ser.close()

serial_com2Arduino/serial_com2Arduino.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ void loop() {
4444
//Command.a=(int16_t)"Hello World";
4545
//Command.checksum = (uint16_t)(Command.val^ Command.other_val ^ Command.other_val2);
4646
Command.checksum=(uint16_t)Sensor1;
47-
Command2.val=(int16_t)15;
47+
Command2.val=(int16_t)30;
4848
Command2.other_val=(int16_t)42;
49-
Command2.other_val2=(int16_t)25;
49+
Command2.other_val2=(int16_t)50;
5050
//Command.a=(int16_t)"Hello World";
5151
//Command2.checksum = (uint16_t)(Command2.val^ Command2.other_val ^ Command2.other_val2);
52-
Command.checksum=(uint16_t)Sensor2;
52+
Command2.checksum=(uint16_t)Sensor2;
5353

5454
Serial.write((uint8_t *) &Command, sizeof(Command));
5555
Serial.println();

0 commit comments

Comments
 (0)