Skip to content

Instantly share code, notes, and snippets.

@rgm3
Last active April 22, 2017 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgm3/b59842c7084595dd1ccd5673ea405e2b to your computer and use it in GitHub Desktop.
Save rgm3/b59842c7084595dd1ccd5673ea405e2b to your computer and use it in GitHub Desktop.
Problem with pigpio PWM duty cycle 0.0, failure in test_real_pins.py
import gpiozero
from gpiozero.pins.pigpiod import PiGPIOPin
# Place a jumper across these two pins.
# Physical pins # 13 and 15 on a B+
test_pin = PiGPIOPin(27)
input_pin = PiGPIOPin(22)
test_pin.function = 'output'
test_pin.frequency = 100
# I think something is wrong with this line
# see: http://abyz.co.uk/rpi/pigpio/python.html#set_PWM_dutycycle
# "Starts (non-zero dutycycle) or stops (0) PWM pulses on the GPIO."
test_pin.state = 0.0
raw_input("do your measurements, replace the jumper, then press enter")
# test pin appears to be floating, not 0 as expected.
# input pin is at 3.3 volts
# Fails
assert input_pin.state == False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment