Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5160

Beginners • Re: Rpi 5 and Pan Tilt hat

$
0
0
Wow nice,

11 years ago I made this one with the PIB.
Same thing with rc/servo!
https://www.dropbox.com/s/c9mv0za8lapqw ... r.mpg?dl=0
I find one interesting thing. I`m doing following steps:
- shutdown rpi and unplug power wire
- next time i want to use it i plugin power wire and running program with servo control
- it is crashing with message

terminate called after throwing an instance of 'sysfspwm::PWMArgumentException'
what(): пїЅпїЅ\U

- to make it work again i have to go to the terminal and type following commands

Code:

jryba@raspberrypi:~ $ cd /sys/class/pwm/pwmchip6jryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > exportbash: echo: write error: Device or resource busyjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 1 > exportbash: echo: write error: Device or resource busyjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > unexportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 1 > unexportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 1 > exportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > exportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 20000000 > pwm0/periodbash: echo: write error: Device or resource busyjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > unexportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 1 > unexportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > exportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 20000000 > pwm0/periodjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo  1500000 > pwm0/duty_cyclejryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 0 > unexportjryba@raspberrypi:/sys/class/pwm/pwmchip6 $ echo 1 > unexportbash: echo: write error: No such device
after that everything is fine. Is there way to release it from c++ code ?

BTW with simple shutdown or reboot this effect not observed. Only if power supply was removed.

Statistics: Posted by jryba — Tue Mar 19, 2024 9:34 am



Viewing all articles
Browse latest Browse all 5160

Trending Articles