joan2937 / lg

Linux C libraries and Python modules for manipulating GPIO
The Unlicense
57 stars 20 forks source link

lgTxBusy seems to get stuck in busy state forver after 20-30 invocations of this code on raspberry pi 5 #23

Open robertsi opened 6 months ago

robertsi commented 6 months ago

float pulse_width = 0.5 + angle / 180 2; int servoCycles = 18; lgTxServo(_chip.getHandle(), gpio, pulse_width 1000, 50, 0, servoCycles); while (lgTxBusy(_chip.getHandle(), gpio, LG_TX_PWM)) lguSleep(0.01);

joan2937 commented 6 months ago

Please supply a complete example with build instructions.

robertsi commented 6 months ago

Complete code is here https://github.com/robertsi/yahboom-g1-tank/blob/f99b8805165f0e3a3e8f20b45430e0bbf7fa5aa5/g1-tank/include/g1-tank/tank.hpp#L380

I'm using cmake to build...instructions are here https://github.com/robertsi/yahboom-g1-tank/?tab=readme-ov-file#build

joan2937 commented 6 months ago

Could you prepare a shorter example which shows the problem?