Hi There,
I have data read (via DigitalRead) from 17, 9 PhotoTransistors which are used to calculate a coordinate position. At the moment I directly send the streams (Such as "01111110110000011", "111111000") as a stream of characters via Serial.Print(). however, since I wish to speed up the process, for better performance, I'm thinking on whether to encode the bitstream as a Decimal or Hexacimal number, and send that number as a set of several characters.
In this case, the 9 bit sensor value will vary from 0-512 in decimal and the 17 bit sensor value will vary from 0-131072. However, i cant seem to find a function to convert this.
In the foll wing reference,
http://arduino.cc/en/Serial/PrintI note that Serial.print(78, BIN) gives "1001110" but what I really need is a function to do the opposite.
Although I do not know whether performing such a conversion in the arduino will itself slow down the process, my intention is to ensure output at a higher data speed via COM.
Thanks in advance,
LasithG