#define BUZZER 13 #define INIT 200 int buzzoff = 1; int iterator=INIT; int sensorReading; void setup() { for (int i=1;i<14;i++) { pinMode(i, OUTPUT);} } void loop() { if (iterator < 300) {iterator++;} else {iterator=INIT;} sensorReading = analogRead(A0); sensorReading = iterator; for (int i=1;i<14;i++) { if (iterator % 3 ==0) { digitalWrite(i, LOW); delay(100); } else { if (i == BUZZER && buzzoff == 0) {delay(0);} else { analogWrite(i, sensorReading); delay(10); } } } delay(100); for (int i=1;i<14;i++) { digitalWrite(i, LOW); } }
Monday, August 1, 2011
Arduino Uno: Blink and Buzz across all OUTPUT, Photocell at A0 for INPUT Sensor reading
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment