loading

For the Coding Project for INLS 534: Youth and Technology in Libraries, I have developed a Blinking Green Light Hat using the “Cat in the Hat” Hat. This hat is an ideal accessory to wear when reading The Cat in the Hat and Green Eggs and Ham by Dr. Seuss. One may also wear this hat for special celebrations such as Read Across America Day / Dr. Seuss’s Birthday on March 2.

Step 1: Materials Needed

Step 2: Find Code Regarding Blinking Lights

I modified the code that is available within the examples provided by the Arduino Software. To access this code:

  1. First download the Arduino software here: http://arduino.cc/en/main/software
  2. Then follow the path within the software: File ➡ Examples ➡ 01.Basics ➡ Blink

This code was last modified by Scott Fitzgerald on May 8, 2014 and is in the public domain.

I modified the code so that the LED stays on for three seconds instead of one second. I also added code that I found at http://lilypadarduino.org/?page_id=635 so that the LED turns on and off when the slide switch is flipped.

Here is my code:

/*

The code for the switch that controls the LED on the LilyPad Arduino is

from the website at http://lilypadarduino.org/?page_id=635

The code regarding the delay of the blinking LED is in the public domain and may

be found in the Arduino software’s examples of codes.

The code regarding the delay of the blinking LED was

modified May 8, 2014 by Scott Fitzgerald and

I modified the code again on March 12, 2015 to cause the LED to have a delay of three seconds and to designate the correct pins. I received tips about connecting the pins from Casey Rawson.

*/

int ledPin = 13; // LED is connected to digital pin 13

int switchPin = A5; // switch connected to digital pin A5

int switchValue; // a variable to keep track of when switch is pressed

void setup()

{

pinMode(ledPin, OUTPUT); // sets the ledPin to be an output

pinMode(switchPin, INPUT); // sets the switchPin to be an input

digitalWrite(switchPin, HIGH); // sets the default (unpressed) state of switchPin to HIGH

}

void loop() // run over and over again

{

switchValue = digitalRead(switchPin); // check to see if the switch is pressed

if (switchValue == LOW) { // if the switch is pressed then,

digitalWrite(ledPin, HIGH); // turn the LED on

delay(3000); // wait for three seconds

digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW

delay(3000); // wait for three seconds

}

else { // otherwise,

digitalWrite(ledPin, LOW); // turn the LED off

}

}

Step 3: Draw a Diagram

  1. Get a pencil and paper and draw how you will sew the components of the LilyPad to the hat.
  2. Or, use Lucidchart to draw how you will sew the components of the LilyPad to the hat. I made the diagram above by using Lucidchart.
  3. Make sure that the lines of the conductive thread do not touch each other.
  4. In designing and crafting my project, I found helpful hints from Liz Huessy’s Nursery Rhyme Hat, Casey Rawson’s LilyPad Arduino Night and Day Toy, and duniken’s LilyPad Arduino Sensor Demo Mat.

Step 4: Program the LilyPad

  1. Program the LilyPad by starting the Arduino software on your computer and connecting the LilyPad Arduino to your computer with the USB cable.
  2. After writing your code, click on “Verify.”
  3. Once the code is verified, click on “Upload.”

Step 5: Sewing

  1. First, separate the pieces of the LilyPad board from each other.
  2. Next, sew the components of the LilyPad Board onto the hat.
  3. You may use clear nail polish to seal the knots.
  4. Attach the other parts of the LilyPad to the hat with regular thread.
  5. Cover the conductive threads on the inside of the hat with a lining.

Step 6: Look at Your New Hat!

<p>Oh how I love the Cat in the Hat! </p>

About This Instructable

263views

2favorites

License:

More by avidreader300:Blinking Green Light Hat using the “Cat in the Hat” Hat 
Add instructable to: