Arnov Sharma
Published © LGPL

Flux Capacitor PCB badge V3

Made a new version of my FLUX CAPACITOR Project

BeginnerFull instructions provided1 hour1,483

Things used in this project

Hardware components

Microchip attiny13A
×1
8205S Mosfet IC
×4
10K Resistor 0603 Package
×8
PCBWay Custom PCB
PCBWay Custom PCB
×1
leds 0603
×12
SMD Coin Cell holde
×1
Arduino Nano R3
Arduino Nano R3
for programming Attiny
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

body

Schematics

sch

Code

code

C/C++
const int switchPin = 4; 
int pinsCount=4;                        // declaring the integer variable pinsCount
int pins[] = {0,1,3,2};   
int lightMode = 1; 

void setup() 
{
    pinMode(0, OUTPUT);
    pinMode(1, OUTPUT);
    pinMode(2, OUTPUT);
    pinMode(3, OUTPUT);
    pinMode(switchPin, INPUT_PULLUP);
   digitalWrite(0, LOW);
   digitalWrite(1, LOW);
   digitalWrite(2, LOW);
   digitalWrite(3, LOW);
     
}
void loop()
{ 
    if (digitalRead(switchPin) ==LOW) 
    { 
        lightMode = lightMode + 1;
        if (lightMode == 3)
        {
            lightMode = 1;
        }
    }
    if (lightMode == 1)
    {
        digitalWrite(pins[0,1,2,3], LOW);
        delay(300);
    }
    else if (lightMode == 2)
    {
      for (int i=0; i<pinsCount; i=i+1){    // chasing right
      digitalWrite(pins[i], HIGH);         // switching the LED at index i on
      delay(70);                          // stopping the program for 100 milliseconds
      digitalWrite(pins[i], LOW);          // switching the LED at index i off
    }
      for (int i=pinsCount-1; i>0; i=i-1){   // chasing left (except the outer leds)
      digitalWrite(pins[i], HIGH);         // switching the LED at index i on
      delay(70);                          // stopping the program for 100 milliseconds
      digitalWrite(pins[i], LOW);          // switching the LED at index i off
     }
    }
        
    //delay(200); // see text
}

Credits

Arnov Sharma
339 projects • 344 followers
Just your average MAKER
Contact

Comments

Please log in or sign up to comment.