So I have this problem,I'm trying to send sensor data from arduino to python through serial communication.
But the output is a kind of wierd.
Does anyone have an idea on this?
Arduino code: to send sensor data
int sensor1 = 20;
int sensor2 = 40;
int sensor3 = 60;
python code: to receive sent data from arduino
ser = serial.Serial("/dev/ttyACM1",9600,timeout=1)
data = ser.read()
second target : sending multiple sensor data in a single serial.write().
data: 20 40 60
Did you mean to use write, instead of print?
write or print if it results on target output would be nice.
What happened when you tried?
Some comments of the demo-codes on this website are wrong but it show how to "translate" bytes to different formats. Scroll down to
The data coming from the serial line looks kind of funny:
best regards Stefan
b'\x14'` means it's a binary data, a byte with an hexadecimal value of 14 which is 20 in decimal ➜ hence what you sent
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.