modify the serialio.c file so that it continuously takes 960 samples, computes the average, converts the average value to temperature, and prints out the result. you can’t give the buf array as a buffer pointer to read. Instead, you will need to give a pointer to the current position in the buf array like &buf[i], where i is the number of bytes that have been read so far. Every time you do the read, you will need to read 960-i bytes to account for the fact that you have already read i bytes. Once you reach 960 bytes, drop out of the loop and calculate the average and the actual temperature using the formulas below. After you print the temperature, start again, and get a new 960 samples of data. Also, when doing the math, make sure you are doing the calculations using floats or doubles.
modify the serialio.c file so that it continuously takes 960 samples, computes
the average, converts the average value to temperature, and prints out the result. you can’t give the buf array as a buffer
pointer to read. Instead, you will need to give a pointer to the current position in the buf array
like &buf[i], where i is the number of bytes that have been read so far. Every time you do the
read, you will need to read 960-i bytes to account for the fact that you have already read i bytes.
Once you reach 960 bytes, drop out of the loop and calculate the average and the actual temperature
using the formulas below. After you print the temperature, start again, and get a new 960 samples
of data. Also, when
doing the math, make sure you are doing the calculations using floats or doubles.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images