Hello,
I use a minimlist code to communicate between arduino and python. The principle is to trigger specific responses depending of stimuli present in other program using Python.
I use serial port but program cratch after the third stimuli.
My python code is
import serial
ser = serial.Serial ("COM5", 9600)
ser.write ('1')
ser.close
A part of my arduino is :
if (sensordroit>=5){
if (Serial.available()){
Keyboard.press ('b');
Keyboard.release('b');
delay (250);
analogWrite (motorPindroit, 250);
delay (250);
analogWrite (motorPindroit, OUTPUT);
Serial.flush();
}
else{
Keyboard.press ('b');
Keyboard.release('b');
I think the problem comes from on the serial port, but....?
Do you have ideas?
Thank you
GT