currently working on a project with detecting objects via a Camera Module and controlling motors based on the camera detection (if object is in sector A, move motor B down, etc.) using Python. The code itself works on the Pi but due to lots of parameters, the frame freezes once the first motor movement is initialized. In order to overcome this, we would like to let the code run as following Laptop: - Code itself via PyCham - Object detection via Webcam - Detect object reading the coordinates, based on the coordinates, the motors should move up and down (the code itself works already) - Send command to the Pi initiating the motor movement
Raspberry Pi: - Connected via RS232 to the Laptop (with the respective shield) - Receive the command from the Laptop initiating the motor to move in the respective way
The question is now how to best communicate between the Laptop (PyCham environment) and the Pi using the RS232 interface. My understanding is, that the setup above is the most convenient. The object detection itself is made on the Laptop and we "only" have to send commands to the Pi running the motors in the intended way but I frankly speaking do not know how these commands can be given to the Pi.
Any recommendations or complete different approaches?