Closed
Description
//current_time and check_time both are uint32_t, and current_time always large than check_time
Some of my core codeline
current_time = millis();
int v_beats;
v_beats = abs((current_time - check_start)/20 - 40);
Serial.println(v_beats);
Serial port will return negtive number.
But if I change it to
int v_beats;
v_beats = (current_time - check_start)/20 - 40;
v_beats = abs(v_beats);
Serial.println(v_beats);
The result will be OK.