'how to change setmode(board) t setmode(bcm)
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.Board)
ControlPin = [16,18,22,29]
for pin in ControlPin:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin,0)
seq =[
[1,0,0,1],
[1,0,0,0],
[1,1,0,0],
[0,1,0,0],
[0,1,1,0],
[0,0,1,0],
[0,0,1,1],
[0,0,0,1],
[1,0,0,1],
[1,0,0,0],
[1,1,0,0],
[0,1,0,0],
[0,1,1,0],
[0,0,1,0],
[0,0,1,1],
[0,0,0,1],
]
for i in range(512):
for halfstep in range(16):
for pin in range(4):
GPIO.output(ControlPin[pin], seq[halfstep][pin])
time.sleep(0.001)
1.currently able function with board mode,but not able with bcm mode,but i want to use bcm mode, what part of code need to change to make bcm mode work...........................
Solution 1:[1]
import RPi.GPIO as GPIO
PIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(PIN, GPIO.OUT)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Gregor |