File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,14 @@ def read_arduino_data(ser, csv_writer):
88
88
89
89
if (len (buffer ) >= sync_index + PACKET_LENGTH ):
90
90
packet = buffer [sync_index :sync_index + PACKET_LENGTH ]
91
- print (packet )
92
91
if len (packet ) == 17 and packet [0 ] == SYNC_BYTE1 and packet [1 ] == SYNC_BYTE2 and packet [- 1 ] == END_BYTE :
93
92
counter = packet [3 ] # Counter is at index 3
94
93
95
94
# Ensure counter number is exactly one more than the previous one
96
95
if previous_sample_number is not None and counter != (previous_sample_number + 1 ) % 256 :
97
96
missing_samples += (counter - previous_sample_number - 1 ) % 256
98
97
print (f"Error: Expected counter { previous_sample_number + 1 } but received { counter } . Missing samples: { missing_samples } " )
99
- exit ()
100
-
98
+
101
99
previous_sample_number = counter # Update previous sample number to current counter
102
100
103
101
total_packet_count += 1 # Increment packet count only after initial samples are ignored
@@ -119,7 +117,6 @@ def read_arduino_data(ser, csv_writer):
119
117
del buffer [:sync_index + PACKET_LENGTH ]
120
118
else :
121
119
del buffer [:sync_index + 1 ]
122
- print ("Invalid Data Packet" ) # Print message if data packet is invalid
123
120
124
121
def start_timer ():
125
122
"""
You can’t perform that action at this time.
0 commit comments