Go Down

Topic: Serial Communication using USB, Python (Read 473 times) previous topic - next topic

nithinpachady

Hi,

I'm very new to Arduino.

I have created a program for controlling servo movements based on face detection in python, the angles are sent through USB to Arduino.

but I need to control  5 servos at a time, So how can I control all servos at real-time,
How can I read serial data from USB (while doing another process while executing a for loop ), is it possible to multithread in Arduino UNO?

Robin2

Have a look at this Python - Arduino demo and at Serial Input Basics, especially the 3rd example.


Why do you think you need multithreading on the Arduino?

Just send the 5 servo values in a single message and have the Arduino write the values to the appropriate servos.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

nithinpachady


Go Up