1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 12:53:22 +00:00

fixes for #17, hardware pwm works now, still can't change polarity, but i think that's a kernel driver/dtb thing.

This commit is contained in:
Robert Wolterman
2016-12-31 01:43:42 +00:00
parent b12c0ad2fe
commit 7d91bbc47e
9 changed files with 180 additions and 95 deletions

0
test/gptest.py Executable file → Normal file
View File

0
test/omtest.py Executable file → Normal file
View File

18
test/pwmtest.py Executable file → Normal file
View File

@ -49,7 +49,7 @@ if __name__ == "__main__":
# SETUP VARIABLES
PWMGPIO = "PWM0"
RECEIVERGPIO = "CSID0"
COUNT = 50
COUNT = 150
SLEEPTIME = 0.01
# LOAD THE PWM OVERLAY
@ -59,13 +59,14 @@ if __name__ == "__main__":
time.sleep(1)
# CLEANUP THE GPIO
GPIO.cleanup()
PWM.cleanup()
#GPIO.cleanup()
#PWM.cleanup()
# SETUP PWM
try:
print("PWM START")
PWM.start(PWMGPIO, 35, 20, 0)
PWM.toggle_debug()
PWM.start(PWMGPIO, 15, 50, 1)
PrintPwmData()
# UNCOMMENT FOR CRASH
@ -79,10 +80,11 @@ if __name__ == "__main__":
#PrintPwmData()
# SETUP PWM RECEIVER
rcvr = PWMReceiver(GPIO, RECEIVERGPIO, COUNT, SLEEPTIME)
rcvr.start()
#rcvr = PWMReceiver(GPIO, RECEIVERGPIO, COUNT, SLEEPTIME)
#rcvr.start()
time.sleep(COUNT*SLEEPTIME + 1)
#time.sleep(COUNT*SLEEPTIME + 1)
raw_input("PRESS ENTER WHEN DONE")
except:
raise
@ -92,6 +94,6 @@ if __name__ == "__main__":
PWM.stop(PWMGPIO)
PWM.cleanup()
#OM.unload("PWM0")
GPIO.cleanup()
#GPIO.cleanup()

0
test/spwmtest.py Executable file → Normal file
View File

0
test/test_gpio_input.py Executable file → Normal file
View File