Question: Programming for arduino: First assign your variables outside of either function. This will be 2 button states and 2 button pins. Next in the void

Programming for arduino:

First assign your variables outside of either function. This will be 2 button states and 2 button pins.

Next in the void setup() function set serial communication to a 9600 baud rate. Also set your pins to be input pins.

In the void loop() function use an if/elseif/else statement to send button 1 is pressed, button 2 is pressed, or nothing is pressed.

* For extra credit instead of doing item 3 your program begins by sending The current count is at 0 over serial.

*Every time a button is pressed send over serial the new count.

*The count only changes once for each press of a button.(using a delay() function will not work if a button is pressed too quickly or for too long and should not be used in this exercise)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!