I'm having a lot of trouble understanding the difference between the terms Serial and Stream. Is Serial not a type of Stream?
I have questions on homework that I just don't understand.
Computers "read" the data they send each other by using (Streams or Serial?) to determine what each byte means?
Also, Serial.write() confuses me a lot too. It returns a byte of data, correct? A byte is 8 bits. So if an int type (16-bits) is passed to Serial.write() on the Arduino, it would return 2 bytes to the serial stream?
Similarly, if a variable is an unsigned long in Arduino C, how can we represent the most significant byte of this variable to the serial stream using Serial.write()?
For example, I have variable x as the unsigned long. Would Serial.write(x>>8) be the correct answer, because a long is 32 bits so unsigned makes it twice as big. Since Serial.write() returns in bytes, 64/8 would be 8.
All of these questions may seem really amateur, but I really want to learn this stuff and my teacher is not the best at explaining. If anyone can make this more clear conceptually, I will be eternally grateful. Thank you!
arduinotag. Also, unsigned does not make a variable twice as big.