Created
May 5, 2020 11:05
-
-
Save EDISON-SCIENCE-CORNER/d7c3cfe496740f9aadee69ba6dc71694 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//EDISON SCIENCE CORNER | |
//EDISON SCIENCE CORNER | |
//EDISON SCIENCE CORNER | |
int analogPin = A0; | |
int val = 0; | |
void setup() { | |
Serial.begin(9600); | |
for (int i = 2; i <=13; i++) { | |
pinMode(i, OUTPUT); | |
} | |
} | |
void loop() { | |
val = analogRead(analogPin); | |
Serial.println(val); | |
int analogvalue=val/10; | |
for (int x = 2; x <= analogvalue; x++) { | |
digitalWrite(x, HIGH); | |
} | |
for (int y = 13; y >= analogvalue; y--) { | |
digitalWrite(y, LOW); | |
} | |
} | |
//EDISON SCIENCE CORNER | |
//EDISON SCIENCE CORNER | |
//EDISON SCIENCE CORNER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment