i have following problem. I have an Arduino Nano with some simple sensors. Im writing the sensor data to the serial port. And im reading it with a simple python skript. However the communication only works if i activate the "serial monitor" in the arduino IDE. Any suggestions why this is the case ?
Okay heres some of my code, i thought it is not needed, because it is actually very simple:
Arduino Code:
in loop:
int sensorValueL = analogRead(A5);
int sensorValueR = analogRead(A6);
Serial.print(sensorValueL); //Write the value of the photoresistor to the serial monitor.
Serial.print(","); //Write the value of the photoresistor to the serial monitor.
Serial.print(sensorValueR); //Write the value of the photoresistor to the serial monitor.
Serial.print("\n");
and on the python side i try to read it this way:
#Only once
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)