Created
February 16, 2017 22:09
-
-
Save angelaperrone/e41c35ff752e16e9675b6e7b1ae2b204 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
const int pin10 = 2; | |
const int pin9 = 3; | |
const int pin8 = 4; | |
const int pin7 = 5; | |
const int pin6 = 6; | |
const int pin5 = 7; | |
const int pin4 = 8; | |
const int pin3 = 9; | |
const int pin2 = 10; | |
const int pin1 = 11; | |
const int ledPin = 13; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(pin10, INPUT); | |
pinMode(pin1, INPUT); | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { | |
int rotary10=digitalRead(pin10); | |
int rotary9 =digitalRead(pin9); | |
int rotary8=digitalRead(pin8); | |
int rotary7 =digitalRead(pin7); | |
int rotary6=digitalRead(pin6); | |
int rotary5 =digitalRead(pin5); | |
int rotary4=digitalRead(pin4); | |
int rotary3 =digitalRead(pin3); | |
int rotary2=digitalRead(pin2); | |
int rotary1 =digitalRead(pin1); | |
Serial.print("Pin One: "); | |
Serial.println(rotary1); | |
Serial.print("Pin 10: "); | |
Serial.println(rotary10); | |
if (rotary10 == HIGH) { | |
digitalWrite(ledPin, HIGH); | |
} else if (rotary10==LOW){ | |
digitalWrite (ledPin, LOW); | |
} | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment