Maplin 3D Xmas Tree Build – Fail

Posted on 01/12/2015 by Adam

I attempted to build a fairly simple electronics kit to decorate the solar shed for Christmas. It’s a simple Astable Multivibrator based circuit which I couldn’t manage to get working as it should. Never fear – add a microcontroller and we’ll get those leds to flash! The code for this project is further down the page:


int LED_A = 2;
int LED_B = 4;
int LED_C = 7;
int LED_D = 8;

void setup() {

pinMode(LED_A, OUTPUT);
pinMode(LED_B, OUTPUT);
pinMode(LED_C, OUTPUT);
pinMode(LED_D, OUTPUT);
}

void loop() {

digitalWrite(LED_A, random(0,2));
digitalWrite(LED_B, random(0,2));
digitalWrite(LED_C, random(0,2));
digitalWrite(LED_D, random(0,2));
delay(random(100,1000));
}

Be the first to leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *