Commit 87b0dc6c authored by fire's avatar fire

initial commit

parents
source code for the blinkenbread house jeenode
TODO:
leak reciepe & blueprints
/*
*/
#define LEDA 4 // orange LED connected to digital 4 (Port1 D)
#define LEDB 14 // yellow LED connected to analog 14 (Port1 A)
#define LEDC 5 // orange LED connected to digital 5 (Port2 D)
#define LEDD 15 // yellow LED connected to analog 15 (Port2 A)
#define LEDE 6 // orange LED connected to digital 6 (Port3 D)
#define LEDF 16 // yellow LED connected to analog 16 (Port3 A)
#define LEDG 7 // orange LED connected to digital 7 (Port4 D)
#define LEDH 17 // yellow LED connected to analog 17 (Port4 A)
#define DELAY 1000 // delay time
void setup() {
pinMode(LEDA, OUTPUT);
pinMode(LEDB, OUTPUT);
pinMode(LEDC, OUTPUT);
pinMode(LEDD, OUTPUT);
pinMode(LEDE, OUTPUT);
pinMode(LEDF, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDH, OUTPUT);
}
void loop() {
digitalWrite(LEDA, LOW);
digitalWrite(LEDB, HIGH);
digitalWrite(LEDC, LOW);
digitalWrite(LEDD, HIGH);
digitalWrite(LEDE, LOW);
digitalWrite(LEDF, HIGH);
digitalWrite(LEDG, LOW);
digitalWrite(LEDH, HIGH);
delay(DELAY);
digitalWrite(LEDA, HIGH);
digitalWrite(LEDB, LOW);
digitalWrite(LEDC, HIGH);
digitalWrite(LEDD, LOW);
digitalWrite(LEDE, HIGH);
digitalWrite(LEDF, LOW);
digitalWrite(LEDG, HIGH);
digitalWrite(LEDH, LOW);
delay(DELAY);
}
/*
*/
#define LEDA 3 // orange LED connected to digital pin 3 (Port2 IRQ)
#define LEDB 5 // yellow LED connected to digital pin 5 (Port2 Digital)
#define DELAY 10 // delay time
void setup() {
pinMode(LEDA, OUTPUT);
pinMode(LEDB, OUTPUT);
digitalWrite(LEDA, LOW);
digitalWrite(LEDB, LOW);
}
void loop() {
for(int fadeValue = 40 ; fadeValue <= 255; fadeValue +=1) {
analogWrite(LEDA, (fadeValue));
analogWrite(LEDB, (295 - fadeValue));
delay(DELAY);
}
for(int fadeValue = 255 ; fadeValue >= 40; fadeValue -=1) {
analogWrite(LEDA, (fadeValue));
analogWrite(LEDB, (295 - fadeValue));
delay(DELAY);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment