Arduino Input & Output

Drawing from last week’s project, I decided to use the Arduino to make the switch do what I wanted it to. I wanted the red LED to light when a goal was scored.

The input is the switch. When the switch is on the red LED turns on, making redLED the output. When a goal is scored the switch is engaged, thus the red LED turns on. Simultaneously, the Serial Monitor prints the text “GOOOAAAALLLL!!” when a goal is scored.

Screen Shot 2015-09-23 at 2.06.29 PM
Here is the my code to the right. The Serial Monitor is displayed on the left. GOOOAAAALLLL!!!!

Here is a video of the project. You will notice when the ball hits the net/foil the red LED turns on. It’s a little difficult to view here. I also show how the program is responding to the ball touching the goal. While the ball can be heard rolling in the background, we see the Serial Monitor updating and printing more lines of “GOOOAAAALLLL!!!”

Input/Output from hnikita on Vimeo.

Though this is a simple circuit, it allowed me to review the basics of coding we learned last week. My creativity might not be top notch (yet) but the brain is keeping up with the learning!!! 🙂

Leave a Reply

Your email address will not be published.