Started dealing with a display, that is feeding data through the serial.
For the trial purpose Im so far only feeding what page Im on.
The recevied data is;
I received: 170
I received: 120 (This change to 121 when i touch)
I received: 0
I received: 1 (This is the page number. For now only 0 and 1)
I received: 204
I received: 51
I received: 195
I received: 60
On the display datasheet the received data is as follow:
AA <Touch_Code> CC 33 C3 3C
My question is:
Can some one please suggest how to convert this row of values into single reference like page0,page1 and so on?
I receive all that at once so it does match what the display sends and match what i receive- AA 78 00 10 CC 33 C3 3C
I received: 170 -AA
I received: 120 -78
I received: 0 -00
I received: 1 -01
I received: 204 -CC
I received: 51 -33
I received: 195 -C3
I received: 60 -3C
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(115200); // opens serial port, sets data rate to 9600 bps
Serial3.begin(115200);
}
void loop() {
// send data only when you receive data:
if (Serial3.available() > 0) {
// read the incoming byte:
incomingByte = Serial3.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, HEX);
}
}
So data is correct, however this is to my understanding this is 8 bit of data at once and I`m asking how to convert that or use as reference to something like if(page1)==true- do something
The problem I see is when for example you get 1 in bit3 and bit8 or another function message. Then you would not be able to use what you suggest.
I was wondering whether I can somehow convert the entire 8 separate values onto one unique either number or character
The 256 is reserved but im not sure what for hence 255 is the highest number. Anyway, why Bob? why are we now spaming this post with stuff that isnt relevant and we taking junk rather than achiveing anyting? 7 posts wasted. Whoever now see this won`t be bothered stepping in with assistance.
If you do not get that the odds of the project working successfully is slim. Put this in front of your screen? "8 bits make 1 byte but it takes two bytes to make a word". Do that and in about a week it will no longer be a problem. Try this link for some more information. What are bits, bytes, and other units of measure for digital information?
All I asked is how to convert what I received to array. Forget it. Appears I am to dumb for that anyway and that's for helping me finally understand it.