Serial Monitor affected by Serial.Read?
hey guys, i'm using keystrokes in processing control stepper motor through arduino. put, when press s key on keyboard, processing myport.write 's' on serial port arduino executes functions stepper motor. arduino reading with:
the serial monitor run issues. either serial.available() or serial.read() seems interfere arduinos ability serial.print correctly. serial monitor randomly write incomplete or partial line or print value of next lines letters tacked on end, , on. on place , jittery.
example;
position
p
pos
p
p
position: 20po
sition: 22position:
it seems when arduino reading serial data processing messes data i'm trying print (serial.print) in serial monitor. arduino "listening" , messing ability print serial monitor correctly. suspect there way free serial port serial.read allow serial.print send data uninterrupted or whole. or else completely? appreciated.
dan
code: [select]
if(serial.available()) { // if data available read,
char val = serial.read(); // read , store in val
}
counter++:
if (val == 's') {
serial.println(counter);
}
the serial monitor run issues. either serial.available() or serial.read() seems interfere arduinos ability serial.print correctly. serial monitor randomly write incomplete or partial line or print value of next lines letters tacked on end, , on. on place , jittery.
example;
position
p
pos
p
p
position: 20po
sition: 22position:
it seems when arduino reading serial data processing messes data i'm trying print (serial.print) in serial monitor. arduino "listening" , messing ability print serial monitor correctly. suspect there way free serial port serial.read allow serial.print send data uninterrupted or whole. or else completely? appreciated.
dan
i don't see why should have problem.
post complete arduino code , explanation of processing doing.
...r
post complete arduino code , explanation of processing doing.
...r
Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Serial Monitor affected by Serial.Read?
arduino
Comments
Post a Comment