value = (userInput << 8) + userInput;
Code: [Select]value = (userInput << 8) + userInput;
Code: [Select]Serial.println(1,BIN);I get 110001...Is this just a serial.print abbreviation or is it actually discarding the first zeros?
If you send the number as a string then you can use the atoi() function to convert the string to an integer.I can't remember if there is a size limit to the integer you can get this way.atoi() is a standard c function that is not documented in the Arduino reference. Google it to see the syntax.atoi() will add quite some bytes to the size of your sketch though.Edit: check this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1176289764
startbyte = Serial.read();
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16