Something is wrong with my code... - Raspberry Pi Forums


i've been trying use code motors on robot school project:

import rpi.gpio io
import time

io.setmode(io.bcm)
pins = [17, 18, 22, 23]
pin in pins:
io.setup(pin, io.output)

#test motors spinning each 1 way other 0.5 sec delay
pin in pins:
print ('testing pin ' + str(pin))
io.output(pin, 1)
time.sleep(0.5)
io.output(pin, 0)

however, whenever says in line 7 have "typeerror: integer required". do?

please place code in code blocks ... use code buttons @ top of editor...

... problem :

code: select all

io.output 
should be:

code: select all

io.out 

try that... work !


raspberrypi



Comments