@@ -39,9 +39,8 @@ void loop(){
39
39
Serial.print (button.timeSinceFirstPress ()/1000.0 );
40
40
Serial.print (" s since the button was first pressed " );
41
41
}
42
-
43
42
// if the queue of pressed events is empty, just print that the queue is empty!
44
- if (button. isPressedQueueEmpty () == true ) {
43
+ else {
45
44
Serial.print (" ButtonPressed Queue is empty! " );
46
45
}
47
46
@@ -53,7 +52,7 @@ void loop(){
53
52
Serial.print (" s since the button was first clicked" );
54
53
}
55
54
// if the queue of clicked events is empty, just print that the queue is empty!
56
- if (button. isPressedQueueEmpty () == true ) {
55
+ else {
57
56
Serial.print (" ButtonClicked Queue is empty!" );
58
57
}
59
58
@@ -63,13 +62,19 @@ void loop(){
63
62
64
63
uint8_t data = Serial.read ();
65
64
if (data == ' p' || data == ' P' ) { // if the character is p or P, then pop a value off of the pressed Queue
66
- button.popPressedQueue ();
67
- Serial.println (" Popped PressedQueue!" );
65
+ long pressedPopped = button.popPressedQueue ();
66
+ Serial.print (" Popped from PressedQueue: " );
67
+ Serial.println (pressedPopped/1000.0 );
68
+ // Wait before continuing on
69
+ delay (3000 );
68
70
}
69
71
70
72
if (data == ' c' || data == ' C' ) { // if the character is c or C, then pop a value off of the pressed Queue
71
- button.popClickedQueue ();
72
- Serial.println (" Popped ClickedQueue!" );
73
+ long clickedPopped = button.popClickedQueue ();
74
+ Serial.print (" Popped from Clicked Queue: " );
75
+ Serial.println (clickedPopped/1000.0 );
76
+ // Wait before continuing on
77
+ delay (3000 );
73
78
}
74
79
}
75
80
delay (20 ); // let's not hammer too hard on the I2C bus
0 commit comments