Ok, Im the noo noob on the block, so apologies if this question was already addressed in the past.
I am using Python's "serial" module to send data to the Freeduino. I am trying to send integers [0 to 1023] to the Freeduino, but I do not see the intended integers on the Serial monitor.
Python program:
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
for i in range(1024):
ser.write(str(i))
Arduino program:
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = int(Serial.read());
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
On the serial monitor, I see the following:
....
received: 54
I received: 49
I received: 57
I received: 56
I received: 55
I received: 57
I received: 57
I received: 50
I received: 54
I received: 48
I received: 52
I received: 56
I received: 50
How do I get the actual values on the Freeduino?
Thanks in advance,
A