I am currently calculating the average of a series of sensor readings.
Using word variables for accuracy.
Reading the sensor every 3 seconds then adding each reading together to get the sum, then working the average.
The word variable used to store the sum value is filled ( more than 65535) quickly.
I would like to know if there is a way of combining 2 word variable in to allow a 32 bit number to be used .
the maximum value of a byte is 255
the maximum value of a word is 65535
Can I combine two word variables ( 4 byte variables) to give me a maximum number of 4294967295, which I will never exceed,
( It would take 145 days with readings of 1023, every 3 seconds)
I hope I have been more clear this time.
Using word variables for accuracy.
Reading the sensor every 3 seconds then adding each reading together to get the sum, then working the average.
The word variable used to store the sum value is filled ( more than 65535) quickly.
I would like to know if there is a way of combining 2 word variable in to allow a 32 bit number to be used .
the maximum value of a byte is 255
the maximum value of a word is 65535
Can I combine two word variables ( 4 byte variables) to give me a maximum number of 4294967295, which I will never exceed,
( It would take 145 days with readings of 1023, every 3 seconds)
I hope I have been more clear this time.