tips:rasberry:gpio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tips:rasberry:gpio [2016/05/19 09:28] scipiotips:rasberry:gpio [2016/05/19 09:43] (current) scipio
Line 3: Line 3:
   * [[http://elinux.org/RPi_GPIO_Interface_Circuits|interface circuits]]   * [[http://elinux.org/RPi_GPIO_Interface_Circuits|interface circuits]]
  
-GPIO numbers+GPIO numbers (BCM mode)
  
 {{:tips:rasberry:gpio-numbers-pi2.png|}} {{:tips:rasberry:gpio-numbers-pi2.png|}}
  
-physical number+physical number (BOARD mode)
  
 {{:tips:rasberry:physical-pin-numbers.png|}} {{:tips:rasberry:physical-pin-numbers.png|}}
Line 17: Line 17:
 sleep 2 sleep 2
 gpio -g write 17 0 gpio -g write 17 0
 +</code>
 +
 +python
 +<code>
 +import RPi.GPIO as GPIO
 +import time
 +
 +GPIO.cleanup()
 +GPIO.setmode(GPIO.BOARD)
 +
 +channel=11
 +GPIO.setup(channel, GPIO.OUT)
 +
 +while True:
 +    GPIO.output(channel, GPIO.HIGH)
 +    time.sleep(1)
 +    GPIO.output(channel, GPIO.LOW)
 +    time.sleep(1)
 +    
 +
 </code> </code>
  • tips/rasberry/gpio.1463642905.txt.gz
  • Last modified: 2016/05/19 09:28
  • by scipio