Friday, April 14, 2023

Led flux capacitor with Attiny85

 


Code below for Attiny85 flux capacitor effect:


void setup() // setup all pins as OUTPUTS to drive current for 

{            // the LEDs.

  pinMode(4, OUTPUT);

  pinMode(3, OUTPUT);

  pinMode(2, OUTPUT);

  pinMode(1, OUTPUT);

  pinMode(0, OUTPUT);

}


void loop(){

  digitalWrite(4, HIGH);

  delay(60);           

  digitalWrite(4, LOW); 

  delay(60);           

  digitalWrite(3, HIGH);

  delay(60);            

  digitalWrite(3, LOW); 

  delay(60);            

  digitalWrite(2, HIGH); 

  delay(60);           

  digitalWrite(2, LOW); 

    delay(60);  

  digitalWrite(1, HIGH); 

    delay(60);  

  digitalWrite(1, LOW); 

    delay(60);  

  digitalWrite(0, HIGH);

    delay(60);   

  digitalWrite(0, LOW);  

  delay(700);            // 500 ms delay

}

No comments:

Post a Comment