PDA

View Full Version : Slider Pyqt for Servo Motors



robikod
23rd August 2017, 08:04
Hi everyone,

I want to do slider, but this slider include 0-180 degres angles and every one degres i receive this degre information and convert to ascii charackter. And then i send to my other program on stm32 (C++ side). How can i do this. I want to controll with 0-180 degres servos

d_stranz
23rd August 2017, 18:12
Use QSlider, set the range to be 0 - 180, set the singleStep property to 1, and connect a slot to the QSlider::valueChanged(). In your slot, convert the integer value to ASCII and send it to your servo controller.

If you don't understand what this means, then I suggest you look at the Qt documentation and the many, many Qt examples and tutorials that came with your Qt distribution and teach yourself the fundamentals of Qt GUI programming.