I am relatively new to programming the Arduino, and I've seen example programs which use Serial.available() > 0 and read the byte in the buffer, but I'm looking for some example code that waits for a pair of bytes, and sets the value of two variables, each variable for each byte received.
Since I am pretty new to programming the Arduino, so I'd be very grateful to anybody who would be willing to create some example code which does what I described above.
Also, keep in mind that I opened this thread looking for somebody to reply with some example code that receives two bytes, not for somebody to tell me that I asked the question wrong and then refer me to some code that doesn't execute the criteria I listed.
Well, bear in mind that this forum is for paid assistance or finding someone to work on a project with you. There are other fora for general help. That said: this should work
while (Serial.available < 2)
delay(100);
int b1 = Serial.read();
int b2 = Serial.read();
There are "better" ways to do it but this is straightforward and easy to follow.