There are a couple of things we could try with this hardware.

Firstly, you could try taking what you learnt in lesson 5 and adding some commands to the sketch that print something to the Serial Monitor whenever either switch is pressed.

Remember that as well as printing out a message using something like this in your 'loop' function:

Serial.println(“Button A Pressed”);

You will also need to start serial communication in the 'setup' function by doing this:

while (!Serial);

A second modification that you could make would be to make the buttons do something different. So, for example you could change the sketch so that if button A is pressed, the LED turns on, but then turns off again after 30 seconds.

Hint: Think of this as being a very slow blink.

About the Author

Simon Monk is author of a number of books relating to Open Source Hardware. The following books written by Simon are available from Adafruit: Programming Arduino30 Arduino Projects for the Evil Genius and Programming the Raspberry Pi.

This guide was first published on Dec 05, 2012. It was last updated on Mar 08, 2024.

This page (Other Things to Do) was last updated on Oct 10, 2012.

Text editor powered by tinymce.