mcardlea
Published

Blinking Light Bucket Hat

This is a fun way to spice up a bucket hat for your next event

IntermediateShowcase (no instructions)271
Blinking Light Bucket Hat

Things used in this project

Hardware components

ProtoSnap - LilyPad Development Board
SparkFun ProtoSnap - LilyPad Development Board
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1
Sewable Conductive Thread
Sewable Conductive Thread
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Sketch of Components

This sketch shows how I connected the components together to make the project successful

Code

Code for Yellow, Green, and Red Blinking Lights

Arduino
Paste this code into Arduino and upload to your board to make it work.
/*
LilyPad ProtoSnap Plus Activity 1: Blinking LEDs
SparkFun Electronics
https://www.sparkfun.com/products/14346

Blink the pair of yellow LEDs attached to sew tab A5 on the LilyPad USB Plus

Follow the tutorial at: https://learn.sparkfun.com/tutorials/lilypad-protosnap-plus-activity-guide#1-blinking-leds

This example is based on: Blink by Scott Fitzgerald
https://www.arduino.cc/en/Tutorial/Blink

This code is released under the MIT License (http://opensource.org/licenses/MIT)

******************************************************************************/

// The setup function runs once when the microcontroller starts up or resets:

void setup()
{
  // Before you use a sew tab (pin), you must set it to be either an input or output:
  
  pinMode(A5, OUTPUT)
  ,pinMode(A7, OUTPUT)
  ,pinMode(6, OUTPUT);     // Set pin A5 to be an output
}

// After the setup function runs, the loop function runs over and over forever:

void loop()
{
  digitalWrite(A5, HIGH);  // Give pin A5 a HIGH voltage level (on), which lights up the LED
  delay(500);             // Pause for 1000 milliseconds (one second), the LED stays on
  digitalWrite(A5, LOW);   // Give pin A5 a LOW voltage level (off), which turns off the LED
  delay(500);             // Pause for 1000 milliseconds (one second), the LED stays off
 digitalWrite(A7, HIGH);  // Give pin A5 a HIGH voltage level (on), which lights up the LED
  delay(1000);             // Pause for 1000 milliseconds (one second), the LED stays on
  digitalWrite(A7, LOW);   // Give pin A5 a LOW voltage level (off), which turns off the LED
  delay(1000); 
  digitalWrite(6, HIGH);  // Give pin A5 a HIGH voltage level (on), which lights up the LED
  delay(3000);             // Pause for 1000 milliseconds (one second), the LED stays on
  digitalWrite(6, LOW);   // Give pin A5 a LOW voltage level (off), which turns off the LED
  delay(3000);   }

Credits

mcardlea

mcardlea

1 project • 1 follower

Comments