Outputting 16 bit and 32 bit Integers with Arduino Uno

I have written some methods in the core Arduino Uno files that now allow you to output 16 bit and 32 bit Integers through a serial connection and other classes implementing the Stream and Print classes.

I have attached the files and how to implement them in the attachment below.

This will allow you to send raw Integers over a serial connection which to my knowledge currently is not implemented.

Please note that these classes will not work correctly with Arduino Due and possibly other Arduino boards.

Arduino UNO new Stream and Print classes.zip (8.79 KB)

This will allow you to send raw Integers over a serial connection which to my knowledge currently is not implemented.

What do you mean by "raw integers"? Does your code cook them?

When you use methods such as parseInteger and use functions to send Integers in the Stream and Print class it pretty much sends and parses them as ASCII characters.

For example the number: 1234 would liturally be sent as "1234". "00110001 00110010 00110011 00110100"

Now if you used my modifications you could just do

sendInt16(1234);

and it would be sent as "10011010010".

This means that data is sent more effciently and more easily in my opinion

Look here and you will understand why I made these modifications: Can't send integer to Arduno from Java - Troubleshooting - Arduino Forum

You see some guy trying to join 2 bytes with bitwise logic when it really is not needed.