//Rotary controls LED int rotaryPin = A0; // select the input pin for the rotary int ledPin = 4; // select the pin for the LED int rotaryValue = 0; // variable to store the value coming from the rotary void setup() { // declare the ledPin as an OUTPUT: pinMode(ledPin, OUTPUT); pinMode(rotaryPin, INPUT); } void loop() { // read the value from the sensor: rotaryValue = analogRead(rotaryPin); // turn the ledPin on digitalWrite(ledPin, HIGH); // stop the program for milliseconds: delay(rotaryValue); // turn the ledPin off: digitalWrite(ledPin, LOW); // stop the program for for milliseconds: delay(rotaryValue); }