Re: Newbe: Nested For..Next loops problem
Hi, Biggazzzz
3 sensors ??? 
could also be written
Code:
mainloop:
For index = 1 to 3 ; read 10 values for 3 sensors
FOR index2 = 1 to 10 ; Take 10 reading
IF temp_val[index2] < temp_val_lo[index] then ; is readlng lower than lowest
temp_val_lo[index] = temp_val[index2] ; update lowest
ELSE IF temp_val[index2] > temp_val_hi[index] then ; is reading higher than highest
temp_val_hi[index] = temp_val[index2] ; update highest
ENDIF
temp1[index] = temp1[index] + temp_val[index2] ; add reading to running total
NEXT index2 ; update next reading
NEXT index ; update next sensor
GOTO mainloop
as you add temp1[index] to total whatever the value ...
Alain
Last edited by Acetronics2; - 12th February 2011 at 14:18.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks