This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tips:rasberry:gpio [2016/05/16 15:29] – scipio | tips:rasberry:gpio [2016/05/19 09:43] (current) – scipio | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| * [[http:// | * [[http:// | ||
| - | GPIO numbers | + | GPIO numbers |
| {{: | {{: | ||
| - | physical number | + | physical number |
| {{: | {{: | ||
| + | |||
| + | test pin 17 | ||
| + | < | ||
| + | gpio -g mode 17 out | ||
| + | gpio -g write 17 1 | ||
| + | sleep 2 | ||
| + | gpio -g write 17 0 | ||
| + | </ | ||
| + | |||
| + | python | ||
| + | < | ||
| + | import RPi.GPIO as GPIO | ||
| + | import time | ||
| + | |||
| + | GPIO.cleanup() | ||
| + | GPIO.setmode(GPIO.BOARD) | ||
| + | |||
| + | channel=11 | ||
| + | GPIO.setup(channel, | ||
| + | |||
| + | while True: | ||
| + | GPIO.output(channel, | ||
| + | time.sleep(1) | ||
| + | GPIO.output(channel, | ||
| + | time.sleep(1) | ||
| + | | ||
| + | |||
| + | </ | ||