I'll upload it again because my previous writing has been erased.
Hello. I'd like to ask you about serial communications.
I'm trying to print the value of the current ADC on a serial monitor using the Serial.print() function.
I'll google it. Serial.From Begin (speed, config), I found that config's default settings are 8data, no parity, and 1 stop bit.
I understand that when you print out a value on a serial monitor, you can only express it up to eight bits.
If it's eight bits, you'll only be able to print numbers from 0 to 256 in the Serial.print function, but the short type and the range of values are the same. After 32,767, there was an overflow, and any negative value was output.
I really want to know why. It's so strange that I think I misunderstood the data on the Internet.
And...
The current code receives the ADC value of 10 bits, and stores the ADC value in the float type variable and outputs it on the serial monitor.
I know that we need to send 8 bits for serial communication, so I'm going to change the float type to the 8-bit data type, the Char type.
When I googled it, is it possible to change it from float type to char type, or is it a problem that can be solved by just changing the shape?
I have a question here. If the ADC value is 1023, is it printed as 255 instead of 1023 when the shape is changed to Char?
Thank you for reading it. Please give me an answer.
// Here's what I wrote in my previous article.
// looked at the subsequent answers and thought.
This is what I thought.
Currently, ADC is being imported into the upper two bits, lower eight bits, by manipulating the register.
You told me to use the Serial.println() and Serial.write() functions confused, but first we looked at Serial.readStringUntil.
Put the value of the top 2 bits into the write() function and the value of the bottom 8 bits into the println() function.
I don't care what you put in the println() function here.
The problem is, if the top two bits are 11, it's actually 768, but the write() function can only store up to 127.I don't know what to do.
Should I use the hexadecimal number of the Aski code?
This is about AsAWOL's answer.
The reason why ADC values are stored in float type variables is that the current code receives 10 ADC values, obtains the average values, and displays them on the serial monitor. But to get the average, we had to use division, but we needed a decimal point, so we used the float type.
While I was writing, I suddenly remembered something.
The Serial.print () function originally could only represent eight bits of data, but in fact, it could represent up to a 16-bit representation of 16 bits.
So, will the problem be solved if I save the ADC value in short form?
But I'm not sure how Serial can express up to 16 bits. etc.) should be written on the PPT.
I've been looking for it through Googleing, but I don't think it's coming out well.
How come the code Serial.println (32767) doesn't go wrong? (The cereal monitor shows 32767 as normal.)
I'm sorry for the long text. Thank you for reading it, and I look forward to hearing from you.

