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

MicroPython • Re: multithreading with Raspberry Pi Pico for model railroad

$
0
0
Have you got any drawings or schematic of this, ? It is very confusing... Pwm with 15 pulses and an input ?
It would help. My reading of it is there are sixteen 2ms slots which continually repeat, 32ms loop time. The speed of 0 to 15 specifying in which slots the PWM pulses are given out, the 16th slot used to monitor the motors. But I may be wrong.

Code:

       15 16  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16  1  2  3       --:--:--.--.--.--.--.--.--.--.--.--.--.--.--.--.--:--:--.--.-- Stop  __:__:____________________________________________:__:________         :  :                                            :  : Slow  __:__||||_________________________________________:__||||_____         :  :                                            :  : Half  __:__||||||||||||||||||||||_______________________:__|||||||||         :  :                                            :  : Fast  |||__||||||||||||||||||||||||||||||||||||||||||||||__|||||||||
It seems to me one doesn't need to convert the pot speed to slots. One could determine how long the PWM should be on and off for. That should make speed control much smoother, less coarse, and could simplify things a lot.

Statistics: Posted by hippy — Fri Aug 02, 2024 12:09 pm



Viewing all articles
Browse latest Browse all 4990

Trending Articles