One Button Simon: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
Line 2: Line 2:


Create a program to time how long the user presses a push button.
Create a program to time how long the user presses a push button.
== Step 1 ==


Starting code / circuit:
Starting code / circuit:


http://arduino.cc/en/Tutorial/Button
http://arduino.cc/en/Tutorial/Button
Make sure your pushbutton circuit is working.
== Step 2 ==
Add some output using Arduino's Serial library to help debug.
<source lang="c">
Serial.println("hello");
</source>


== Exercise ==
== Exercise ==

Revision as of 16:13, 9 November 2010

Exercise

Create a program to time how long the user presses a push button.

Step 1

Starting code / circuit:

http://arduino.cc/en/Tutorial/Button

Make sure your pushbutton circuit is working.


Step 2

Add some output using Arduino's Serial library to help debug.

Serial.println("hello");

Exercise

Record a sequence of button presses (and releases) and have the arduino play back the pattern on the speaker.

Exercise

Write code to translate the presses from the user to a fixed pattern