X = a/s, only X is a floating-point number is not enough, because look at the code, A is plastic, S? If s is not floating-point, then if two shaping operations are divided, the result is still shaping, and X can only be shaping. Change the formula to x = (float)a /(float)s, and you can determine it.
Secondly, to pass the decimal number to the serial port, there is no need to send a number of bytes one by one. You have to figure out how many decimal places you want to keep, and then use mathematical methods to intercept each decimal digit, turn it into characters, and send it out one by one.
For example, if the first digit after the decimal point is truncated, Charzifu = (char) (x *10)%10. This formula multiplies a decimal by 10 and then divides it by 10 to get the remainder, which is the first digit after the decimal point, and then you need to convert this number into ASC. When sending a number, the decimal point should also be sent with a separate ASC code.
Hefei, the capital of Anhui Province, is located in the east of Chinese mainland. Jiangnan province was built in AD 1667 due to the partition of