On Mon, 26 Aug 2019 10:57:36 -0700 (PDT), Marius Strom
<
brmar...@gmail.com> declaimed the
following:
>
># pwm test script
>import Adafruit_BBIO.PWM as PWM
>
>out = "P1_36"
>
>PWM.start(out, 0,frequency=50)
>
>while(1):
> PWM.set_duty_cycle(out, 100)
>
>However, upon running this code, I get the following error message:
>
NOTE: even ignoring the error problem the above code is rather, uhm,
futile...
You start with the PWM set to full OFF, then, in a fast running loop
you repeatedly set it to full ON. You'd get the same result setting the pin
to GPIO mode:
GPIO.setup(out, GPIO.OUT)
GPIO.output(out, GPIO.LOW)
while True:
GPIO.output(out, GPIO.HIGH)
Additionally,
while(1):
appears to be a C-ism, the Pythonic/preferred form is
while True:
and as you can see, you likely wont notice anything on the output pin --
the program sets up the pin at 0 and immediately sets it to 1, 1, 1, 1, 1.
>Traceback (most recent call last):
> File "/var/lib/cloud9/pwm_test.py", line 6, in <module>
> PWM.start(out, 0,frequency=50)
>RuntimeError: Problem with the cape manager
>
Have you attempted to set the pin from the command line using the
config-pin utility? (See the readme at
https://github.com/adafruit/adafruit-beaglebone-io-python ). If that fails
you may need to update the OS device trees etc. since adafruit internally
uses that to set the pin modes. Otherwise, an update of the adafruit
libraries might be needed (there was a PocketBeagle PWM fix in 1.1.0 "fix
pwm on pocketbeagle and beaglebone blue #286" . OR a bug report filed with
AdaFruit.
Okay -- so you have seen the report of the problem, and the solution...
Unfortunately -- since all potential solutions tend to require updates
you'll have to figure out some way to get internet access (I would not
recommend trying to hand install the Adafruit libraries).
Or /maybe/ download and flash a new SD card with either
http://debian.beagleboard.org/images/bone-debian-9.9-iot-armhf-2019-08-03-4gb.img.xz
or
http://debian.beagleboard.org/images/bone-debian-9.9-lxqt-armhf-2019-08-03-4gb.img.xz
and hope that those images include the Adafruit updates. (I'll admit, I'm
still running the 2018-10-07 images myself, on a BBB, but I have no
problems running apt-get and pip to install patches).
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/