Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glyons/94dfa4b17216d6b44f2549b740cfb775 to your computer and use it in GitHub Desktop.
Save glyons/94dfa4b17216d6b44f2549b740cfb775 to your computer and use it in GitHub Desktop.
int led =1 ;
int sensorValue = 5;
int status = false;
void setup() {
digitalWrite(led, true);
pinMode(led, OUTPUT);
}
void loop() {
status = !status;
sensorValue = analogRead(1) +1; //Read P2
pinMode(2, INPUT);
delay(sensorValue*0.5);
digitalWrite(led, status);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment