Can someone assist with the below programming and flowchart?
Part 3: Arduino program from a given flowchart
Here is a flowchart/activity of some algorithm:
Please write a complete Arduino code which will accomplish the same:
Hint: you can always make the circuit in tinkercad and test your code if it works!
San
Set pin 7, 8 as outputs
(this is where LEDs are connected)
Set pin 9 as input
(this is where a button is connected)
Begin serial communication
Read the voltage at pin 9
If voltage is high
Turn the red LED on pin 8 ON
Else
Serial print "button is pressed"
Turn the green LED on pin 7 OFF
Turn the green LED on pin 7 ON
Turn the red LED on pin 8 OFF
Stop