Hey Guys,
New to Arduino but long exposed to microcontrollers (68HC11!)
I've been pulling my hair out wondering why the serial would only read the first digit sent through using:
while (Serial.available() > 0){
/*Don't read unless there you know there is data,
* Data is transmitted in the form "3124, count"
* with the integer value count being the number of returned
* rows of data
*/
Serial.println("In here");
int password2 = Serial.parseInt();
Serial.print(password2,DEC);
if(password2 == 3124 ){ // Password required for transmission
digitalWrite(ledPin, HIGH); // Set the voltage high early (RC rise time)
Serial.print("or in here");
transmitCount = Serial.parseInt();
Serial.print(transmitCount);
getDataSend(transmitCount);
digitalWrite(ledPin, LOW); // Turn off the voltage reference.
} //End of password loop
} // End of serial.Available loop
I originally had the baud rate set to 115200 bits/sec (as i'm using an Arduino bluetooth mate silver) but it would only ever read the first digit that i sent through of the format: "3124, 10" --> would read just "3".
I found it worked with a baud rate of 9600 however. I intentionally put a question mark in the title in case I may have done something wrong which someone could point out...