Skip to content

Instantly share code, notes, and snippets.

@dwblair
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save dwblair/991b549d73b7c2554c1d to your computer and use it in GitHub Desktop.

Select an option

Save dwblair/991b549d73b7c2554c1d to your computer and use it in GitHub Desktop.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://www.arduino.cc
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
*/
const int pinA = 4;
const int pinB = 5;
const int pinC = 6;
const int sensorPin = A0;
const int waitTime = 3000; // in milliseconds
float measurement;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(pinA, OUTPUT);
pinMode(pinB, OUTPUT);
pinMode(pinC, OUTPUT);
//analogReference(EXTERNAL);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
// all off
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
delay(waitTime);
// one on
digitalWrite(pinA,HIGH);
delay(waitTime);
// two on
digitalWrite(pinB,HIGH);
delay(waitTime);
// three on
digitalWrite(pinC,HIGH);
//measurement=lightSample();
//Serial.println(measurement);
delay(waitTime*2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment