Things used in this project

Hardware components:
Osh park
OSH Park Custom fabricated PCB
Link: https://oshpark.com/projects/RmkVGeN9/
×1
08377 02 l
Resistor 330 ohm
1/8w or 1/6W should be sufficient
×5
Atmel ATtiny85 SOIC
×1
0805 SMD LED
×5
Adafruit industries ada654 image 75px
Coin Cell Battery CR2032
×1
CR2032 Holder
×1
SPDT Slide Switch
×1
A000066 iso both
Arduino UNO & Genuino UNO
Only needed for programming the ATtiny
×1
Panasonic eca1hm2r2
Capacitor 10 µF
Only needed for programming the ATtiny
×1
Adafruit industries ada1008 image 75px
Alligator Clips
Only needed for programming the ATtiny
×6
Software apps and online services:
Autodesk circuits.io - 123D Circuits
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)
tweezer
Multimeter
Must have diode mode

Schematics

Code

Demo.inoArduino
//Code produced by Alex Wulff: www.AlexWulff.com

//Pin definitions for Rev. 1
#define led1  0
#define led2  1
#define led3  4
#define led4  2
#define led5  3

bool enableOne = true;
bool enableTwo = false;
bool enableThree = false;
bool enableFour = false;
bool enableFive = false;
bool programmingLightMode = false;
bool lightMode = false;

bool dotMode = false;

void setup() {
  pinMode(led1, INPUT_PULLUP);
  pinMode(led2, INPUT_PULLUP);
  pinMode(led3, INPUT_PULLUP);
  pinMode(led4, INPUT_PULLUP);
  pinMode(led5, INPUT_PULLUP);
}

void loop() {

  //This means the user wants to enter programming mode
  if (digitalRead(led1) == 0 && !programmingLightMode) {
    programmingLightMode = true;
    pinMode(led1, OUTPUT);
    for (int i = 0; i < 4; i++) {
      digitalWrite(led1, HIGH);
      delay(300);
      digitalWrite(led1, LOW);
      delay(300);
    }
    pinMode(led1, INPUT_PULLUP);
  }

  //This means the user wants to enter the demo mode
  if (digitalRead(led2) == 0 && !programmingLightMode) {
    dotMode = true;
  }

  //This will check to see if any of the lighs have been selected
  if (programmingLightMode) {
    if (digitalRead(led1) == 0) {
      lightMode = true;
    }
  
    else if (digitalRead(led2) == 0) {
      enableTwo = true;
    }
  
    else if (digitalRead(led3) == 0) {
      enableThree = true;
    }
  
    else if (digitalRead(led4) == 0) {
      enableFour = true;
    }
  
    else if (digitalRead(led5) == 0) {
      enableFive = true;
    }
  }
  
  //This is displayed at the end of the programming mode
  if (lightMode) {
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    pinMode(led4, OUTPUT);
    pinMode(led5, OUTPUT);
    digitalWrite(led1, enableOne);
    digitalWrite(led2, enableTwo);
    digitalWrite(led3, enableThree);
    digitalWrite(led4, enableFour);
    digitalWrite(led5, enableFive);
    while(true); //Should sleep here
  }

  //If dot mode is selected or the chip has been sitting, enter demo mode
  if (dotMode || (millis() >= 10000 && !programmingLightMode)) {
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    pinMode(led4, OUTPUT);
    pinMode(led5, OUTPUT);

    //Do the demo forever
  	while (true) {doDotMode();}
  }
}

void doDotMode() {
	for (int i = 0; i < 5; i++) {
    switch (i) {
      case 0:
        setLow();
        digitalWrite(led1, HIGH);
        break;
      case 1:
        setLow();
        digitalWrite(led2, HIGH);
        break;
      case 2:
        setLow();
        digitalWrite(led3, HIGH);
        break;
      case 3:
        setLow();
        digitalWrite(led4, HIGH);
        break;
      case 4:
        setLow();
        digitalWrite(led5, HIGH);
        break;
    }
    delay(50);
  }

  for (int i = 4; i >= 0; i--) {
    switch (i) {
      case 0:
        setLow();
        digitalWrite(led1, HIGH);
        break;
      case 1:
        setLow();
        digitalWrite(led2, HIGH);
        break;
      case 2:
        setLow();
        digitalWrite(led3, HIGH);
        break;
      case 3:
        setLow();
        digitalWrite(led4, HIGH);
        break;
      case 4:
        setLow();
        digitalWrite(led5, HIGH);
        break;
    }
    delay(50);
  }
}

void setLow() {
  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  digitalWrite(led3, LOW);
  digitalWrite(led4, LOW);
  digitalWrite(led5, LOW);
}

Credits

Dsc 0358 aupidjdwxg
Alex Wulff
1 project • 38 followers
I'm an 18-year-old maker from Upstate New York. I love Arduino, embedded systems, 3D printing, and iOS development. www.AlexWulff.com
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog