Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int SensorinPinni = A0;
  2.  
  3. int SensorinArvo = 0;
  4.  
  5. void setup(){
  6. Serial.begin(9600);
  7. pinMode(2, OUTPUT);
  8. }
  9. void loop(){
  10. SensorinPinni= analogRead(SensorinPinni);
  11. Serial.println(SensorinPinni);
  12. delay(500);
  13.  
  14. if (SensorinPinni <300) {
  15. digitalWrite(2,HIGH);
  16.  
  17. }
  18. else if (SensorinPinni >300)
  19. {
  20. digitalWrite(2,LOW);
  21. }
  22.  
  23. delay(1000);
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement