LilyPad Sketch Examples

http://geoscience.wisc.edu/eyh/

Ardino examples modified by Caroline Hardin and Deb Deppeler

http://pages.cs.wisc.edu/~deppeler/eyh/LilyPad/LilyPad_Sketches.html

https://www.sparkfun.com/products/11262

Table of Contents

1. Blink
blinks LED on pin 13
2. AnalogSensor
display the value read from the light sensor to console
3. BuzzButton
button on pin A2 controls the buzzer on pin 3
4. HotCrossBuns
plays Hot Cross Buns melody when button is pressed
5. HotCrossBuns_full
plays Hot Cross Buns melody and next verse when button is pressed
6. LightsDemo
turns all LED lights on and off
7. LightUpTheDark
LEDs are turned on when the light is low
8. RainbowsInTheDark
displays red, green, blue, on the tri-color LED when it's dark
9. LetItGo_Color
plays Let It Go melody and lights when button is pressed
10. TreatYouBetter_Color
plays part of "Treat You Better" by Shawn Mendes and lights when button is pressed

 

 

 

Sketch examples:

For each sketch, open the file, compile the sketch, upload the sketch to the card, and then try the button, or switch or light sensor, or temperature sensor. Once you see what the sketch does, try to change it so that the sketch does something else.

  1. Open the LilyPad (ino) sketch file File -> LilyPad -> BuzzButton
  2. Compile the sketch
  3. Upload the sketch
  4. Press the Button labeled A5
  5. What happens?
  6. Change program by making the number inside the "delay(1);" line bigger.
  7. Compile and Upload the sketch
  8. Press the button again.  What happens now?

 

Get an Ozobot and program it at: OzoBlockly.com/editor 

There are lots of example sketches to try, and more information online at:  https://www.arduino.cc/en/Guide/ArduinoLilyPad