File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
libraries/Esplora/examples/Experts/EsploraPong Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 2222#include < Esplora.h>
2323
2424void setup () {
25- Serial.begin (9600 );
25+ Serial.begin (9600 ); // initialize serial communication
2626}
2727
2828void loop () {
29+ // read the slider and three of the buttons
2930 int slider = Esplora.readSlider ();
30- int resetButton = Esplora.readButton (1 );
31- int serveButton = Esplora.readButton (3 );
32- int switchPlayerButton = Esplora.readButton (4 );
31+ int resetButton = Esplora.readButton (SWITCH_1 );
32+ int serveButton = Esplora.readButton (SWITCH_3 );
33+ int switchPlayerButton = Esplora.readButton (SWITCH_4 );
3334
34- Serial.print (slider);
35- Serial.print (" ," );
36- Serial.print (resetButton);
37- Serial.print (" ," );
38- Serial.print (serveButton);
39- Serial.print (" ," );
40- Serial.println (switchPlayerButton);
41- delay (10 );
35+ Serial.print (slider); // print the slider value
36+ Serial.print (" ," ); // add a comma
37+ Serial.print (resetButton); // print the reset button value
38+ Serial.print (" ," ); // add another comma
39+ Serial.print (serveButton); // print the serve button value
40+ Serial.print (" ," ); // add another comma
41+ Serial.println (switchPlayerButton); // print the last button with a newline
42+ delay (10 ); // delay before sending the next set
4243}
4344
You can’t perform that action at this time.
0 commit comments