using larger than 16 bit numbers....still stuck
cplatt
Posts: 55
I am still trying to use larger than 16 bit numbers in math calculations without resorting to using upper memory or very long loops. Thanks to everyone's help my code is close but I still cannot get the right average formula when I am using short loops from 50 - 5000 and not counting every loop but just the ones that the data is under 3000.
Thank you for looking!!!!
FOR i = 1 TO 50 GOSUB read_sensor IF sensor <3000 THEN IF (low_sum + sensor < low_sum) THEN high_sum = high_sum + 1 low_sum = low_sum + sensor y=y+1 endif DEBUG ? sensor NEXT average= ??????????? DEBUG ? average END read_sensor: 'read the accelerometer raw data 4000-2000. RETURN
Thank you for looking!!!!
Comments
For exactly 1000 samples, it would be,