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:

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


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Serial Monitor affected by Serial.Read?


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support