Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sensorPin = A0; // select the input pin for the potentiometer
- int sensorValue = 0; // variable to store the value coming from the sensor
- void setup() {
- Serial.begin(9600);
- pinMode(11,OUTPUT);
- }
- void loop()
- {
- sensorValue=analogRead(sensorPin);
- if(sensorValue <= 14)
- digitalWrite(11,HIGH);
- else
- digitalWrite(11,LOW);
- Serial.println(sensorValue);
- delay(2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement