- Pi3 with charging cable, sd card, and initial monitor and keyboard to set up
- miniboard
- 4 cables with pointy end and receiving end
- two resistors
- button
- led
- Set up pi with shell os to ssh
- ssh into pi and create file
- execute file
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(32, GPIO.OUT)
while True: # Run forever
if GPIO.input(10) == GPIO.HIGH:
print("Button was pushed!")
GPIO.output(32, GPIO.HIGH)
else:
GPIO.output(32, GPIO.LOW)
- username: pi
- password: raspberry
raspi-config
to setup wifi and enable ssh
ifconfig
to look up ip address
sudo apt-get install python-rpi.gpio python3-rpi.gpio