Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/07/07 18:18
Read: times


 
#142888 - help required with array manipulation in c#
Hi all,
I have quick question regarding arrays.
I've got a function DS1620_Temperature_Array():

char DS1620_Temperature_Array(){
char temperature_array [20];
int i;
for (i = 0; i < 21; i++){
int get_temp, MSB;
float temperature;
get_temp = DS1620_Read(0xAA, 9);
temperature = (float) get_temp * 0.5;
MSB = get_temp >>7;
if ( MSB > 0 ) temperature = temperature - 256;
temperature_array [i] = temperature;
HW_DELAY_50ms();
}
return (temperature_array);
}

That reads temperature from DS1620 every 50ms and stores it in temperature_array.
Q1: How can I get a average of temperature_array?
Q2: How can I get a max of temperature_array?

Thanks ever so much for your help in advance.

List of 13 messages in thread
TopicAuthorDate
help required with array manipulation in c#            01/01/70 00:00      
   just having formatted            01/01/70 00:00      
   array not float?            01/01/70 00:00      
      Try This            01/01/70 00:00      
         but be sure to comment it carefully!            01/01/70 00:00      
   Why do you keep saying C# ??            01/01/70 00:00      
   Two things that are definitly wrong            01/01/70 00:00      
      Two things wrong with thing 1            01/01/70 00:00      
         Sorry and Thanks            01/01/70 00:00      
   Also..            01/01/70 00:00      
      ...and, 8051 specifically            01/01/70 00:00      
         8051 in C programming            01/01/70 00:00      
            first and second            01/01/70 00:00      

Back to Subject List