s2
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
import RPi.GPIO as GPIO
|
||||||
|
import time
|
||||||
|
|
||||||
|
# photo sensor on PIN 4
|
||||||
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
GPIO.setup(4, GPIO.IN)
|
||||||
|
|
||||||
|
# LED on PIN 17
|
||||||
|
GPIO.setup(17, GPIO.OUT)
|
||||||
|
GPIO.output(17, GPIO.LOW)
|
||||||
|
|
||||||
|
try:
|
||||||
|
print('Start IR test')
|
||||||
|
|
||||||
|
while True:
|
||||||
|
time.sleep(0.25)
|
||||||
|
if (GPIO.input(4) == GPIO.LOW):
|
||||||
|
print('LED OFF')
|
||||||
|
GPIO.output(17, GPIO.LOW)
|
||||||
|
else:
|
||||||
|
print('LED ON')
|
||||||
|
GPIO.output(17, GPIO.HIGH)
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('bye')
|
||||||
|
GPIO.cleanup()
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import RPi.GPIO as GPIO
|
||||||
|
import time
|
||||||
|
|
||||||
|
GPIO.setmode(GPIO.BOARD)
|
||||||
|
|
||||||
|
GPIO.setup(11,GPIO.OUT)
|
||||||
|
GPIO.output(11,GPIO.LOW)
|
||||||
|
|
||||||
|
GPIO.cleanup()
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import RPi.GPIO as GPIO
|
||||||
|
import time
|
||||||
|
|
||||||
|
GPIO.setmode(GPIO.BOARD)
|
||||||
|
|
||||||
|
GPIO.setup(11,GPIO.OUT)
|
||||||
|
GPIO.output(11,GPIO.HIGH)
|
||||||
|
|
||||||
+1
-2
@@ -42,7 +42,7 @@ sudo nano /etc/ntp.conf
|
|||||||
sudo /etc/init.d/ntp restart
|
sudo /etc/init.d/ntp restart
|
||||||
date
|
date
|
||||||
|
|
||||||
sudo apt install mc moc
|
sudo apt install lirc zbar-tools mc moc python3 python-rpi.gpio python3-rpi.gpio
|
||||||
|
|
||||||
# PHAT DAC (https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install)
|
# PHAT DAC (https://learn.pimoroni.com/tutorial/phat/raspberry-pi-phat-dac-install)
|
||||||
curl -sS get.pimoroni.com/phatdac | bash
|
curl -sS get.pimoroni.com/phatdac | bash
|
||||||
@@ -65,7 +65,6 @@ sudo nano /etc/modprobe.d/alsa-base.conf
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- HERE BE DRAGONS ------------------------------------------------------------
|
-- HERE BE DRAGONS ------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user