How do I read in Pulse Widths? - Raspberry Pi Forums
i've got device (sparkfun's 3 coin acceptor: https://www.sparkfun.com/products/11719) outputs signal in pulse widths. how can read signal in?
comfortable using rpi.gpio library simple i/o, i'm not sure this. can handled rpi.gpio?
comfortable using rpi.gpio library simple i/o, i'm not sure this. can handled rpi.gpio?
on phone autocorrect try break this
start = time.time()
stop = time.time()
while gpio.input(pin) == 0:
start = time.time()
while gpio.input(pin) == 1
stop = time.time()
elapsed = stop - start
elapsed equal length of pulse.
start = time.time()
stop = time.time()
while gpio.input(pin) == 0:
start = time.time()
while gpio.input(pin) == 1
stop = time.time()
elapsed = stop - start
elapsed equal length of pulse.
raspberrypi
Comments
Post a Comment