Advertisement
safwan092

aljazimag@gmail.com

Oct 26th, 2017
2,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. int sensorPin = A0;    // select the input pin for the potentiometer
  2. int sensorValue = 0;  // variable to store the value coming from the sensor
  3.  
  4. void setup() {
  5.   Serial.begin(9600);
  6.   pinMode(11,OUTPUT);
  7. }
  8.  
  9. void loop()
  10. {
  11.   sensorValue=analogRead(sensorPin);
  12.   if(sensorValue <= 14)
  13.   digitalWrite(11,HIGH);
  14.   else
  15.   digitalWrite(11,LOW);
  16.   Serial.println(sensorValue);
  17.   delay(2);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement