User Tools

Site Tools


hacks:switch_controlled_blink

This is an old revision of the document!


<code> /* * Switch Controlled Blink * */

int ledPin = 2; int ledPin2 = 3; int valanpin = 0;

void setup() {

pinMode(ledPin, OUTPUT);      
setup2();

}

void loop()

valanpin = analogRead(0);

digitalWrite(ledPin, HIGH);   
delay(10*valanpin);                  
digitalWrite(ledPin, LOW);    
delay(10*valanpin);           
loop2();

}

void setup2() {

pinMode(ledPin2, OUTPUT);   

}

void loop2() {

digitalWrite(ledPin2, HIGH);
delay(10*valanpin);         
digitalWrite(ledPin2, LOW); 
delay(10*valanpin);  

} </code>

hacks/switch_controlled_blink.1385068741.txt.gz ยท Last modified: 2013/11/21 21:19 by jarrett