Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

PWM OK from Console, but not in script #38

Open
diginfo opened this issue Oct 11, 2014 · 1 comment
Open

PWM OK from Console, but not in script #38

diginfo opened this issue Oct 11, 2014 · 1 comment

Comments

@diginfo
Copy link

diginfo commented Oct 11, 2014

If I run the PWM script in the console, then everything works as expected, but if I run it from a script file, then the PWM dies after a few moments:

#!/usr/bin/env python2
from RPIO import PWM
def wdog(GPIO=18,CHAN=0,FREQ=20000):
PWM.setup()
PWM.init_channel(CHAN,FREQ) ## Freq = 199,000us

if(not PWM.is_channel_initialized(CHAN)):
  PWM.clear_channel_gpio(CHAN,GPIO)
PWM.add_channel_pulse(CHAN,GPIO,0,1000)  ## 50%

wdog(22,0)

@kidmose
Copy link

kidmose commented Nov 3, 2014

I've experienced that the PWM output seems to be reset when my scripts exits, i.e. when some object is destroyed. From other issues I've got the impression that it is due to some DMA cleanup.

What do you mean by in the console? Something like:

$ python yourscript.py

Script file? Maybe:

$ ./yourscript.py

Possible related or duplicate issue: #43

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants