Papermind

coun

Dec 29th, 2017
1,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. int sensor = 8;
  2. int count = 0;
  3. void setup() {
  4.   pinMode(sensor, INPUT);
  5.   Serial.begin(9600);  }
  6.  
  7. void loop() {
  8. int ldr = digitalRead(sensor);
  9. if (ldr==LOW){
  10.   count++;
  11.   Serial.print(count);
  12.   delay(100);}}
Advertisement
Add Comment
Please, Sign In to add comment