02_Switch_input02 by rcalmet

Cloned from Sketch 02_Switch_input02 by yasusanto

This sketch is missing a short description

This program is very similar to "e02_Switch_input01" in principle, except that it sends a more specific human-readable messages to the serial monitor instead of "1"s and "0"s.

Again, this program outputs only to Serial Monitor of Arduino. There is no other output (i.e. LEDs are not used).

To open Serial Monitor, you need to click the magnifying glass icon at the top-right of Arduino application.

enter image description here (Serial Monitor Button)

A "if...then...else" statement (or conditional statement) determines which message is to be sent (which line of codes to be executed) depending on the state of two switches (see if... in Arduino's reference page). For example, if both switches are pressed ("0" and "0"), Arduino sends "both ON" to the serial monitor. Please note that Arduino ports receive "0" when a switch is pressed. (see Activ-high and Active-low)

enter image description here

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:382379" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>