![]() We're not using the switch at all at this point. You should have a blinking LED on your circuit. Sudo python gpio_blink.py Note: you have to invoke sudo - root access for the GPIO library. # gpio_blink.py # by Scott Kildall (# LED is on pin 4, use a 270 Ohm resistor to ground import RPi.GPIO as GPIO import time twarnings(False) tmode(GPIO.BCM) tup(4, GPIO.OUT) state = True # endless loop, on/off for 1 second while True: GPIO.output(4,True) time.sleep(1) GPIO.output(4,False) time.sleep(1) Ctrl-X, Y to save the file. Alternatively, I have this on a GitHub repository. The advantage with using ssh is that you can just copy-and-paste the script. ![]() ![]() Sudo nano gpio_blink.py And enter in this script. On the command line, create a new python script by invoking nano. At this point, I run the Raspberry Pi from my monitor with a keyboard plugged in - I usually do the package updates from ssh.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |