Skip to content

Commit

Permalink
rtd+
Browse files Browse the repository at this point in the history
  • Loading branch information
cqusers committed Aug 13, 2021
1 parent eae52ea commit 29da5aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions C/12_photo_interrupter/photo_interrupter.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ int main(void){

LED(temp);
Print(temp);
delay(100);
}
return 0;
}
3 changes: 3 additions & 0 deletions Python/34_tracking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import time

TrackPin = 11
LedPin = 12
Expand All @@ -14,9 +15,11 @@ def loop():
while True:
if GPIO.input(TrackPin) == GPIO.LOW:
print ('White line is detected')
time.sleep(0.5)
GPIO.output(LedPin, GPIO.LOW) # led on
else:
print ('...Black line is detected')
time.sleep(0.5)
GPIO.output(LedPin, GPIO.HIGH) # led off

def destroy():
Expand Down

0 comments on commit 29da5aa

Please sign in to comment.