/* Blink Turn a Transistor on for one second, then off for one second, repeatedly. The circuit: NPN Transistor connected from digital pin 2 (base) to ground (emitter). The load (here a relay) connected to power (5V) from transistor collector Created 16 Aug 2020 based on an original by H. Barragan for the Wiring i/o board */ const int DRIVE_PIN = 2; // Transistor base connected to digital pin 2 // The setup() method runs once, when the sketch starts void setup() { // initialize the digital pin as an output: pinMode(DRIVE_PIN, OUTPUT); } // the loop() method runs over and over again, // as long as the Arduino has power void loop() { digitalWrite(DRIVE_PIN, HIGH);// turn the Green LED on delay(1000); // wait for a second digitalWrite(DRIVE_PIN, LOW); // turn the Red LED on delay(1000); // wait for a second }