Sensiron SHT 7x Temperature and humidity device library
Dependents: temp xj-Nucleo-F303K8-SHT75-TEST
Diff: sht7X.h
- Revision:
- 3:c6a7a49099fe
- Parent:
- 2:dd218144f9fe
- Child:
- 4:9a5e846258a9
--- a/sht7X.h Wed Oct 27 16:09:11 2010 +0000 +++ b/sht7X.h Wed Oct 27 16:23:25 2010 +0000 @@ -33,14 +33,14 @@ const float T1= +0.01; // for 14 Bit @ 5V const float T2= +0.00008; // for 14 Bit @ 5V -/** SHT7x class +/** Servo control class, based on a PwmOut * * Example: * @code * //initialise the device read temperature ticks, read humidity ticks and then -* calculate the liniarised humidity value. +* // calculate the liniarised humidity value. * #include "mbed.h" -* #include "SHT7X.h" +* #include "sht7X.h" * * SHT75 sht(p12, p11); * Serial pc(USBTX, USBRX); @@ -49,10 +49,10 @@ * { * float temperature; // temperature -40 to 120 deg C * float humidity; // relative humidity 1% to 100% -* float humi_f,rh_li,rh_true; // working registers for Illustration purposes +* float humi_f,rh_lin,rh_true; // working registers for Illustration purposes * int t; // temporary store for the temp ticks * int h; // temp store for the humidity ticks - +* * pc.baud(115200); * * while(1) @@ -63,14 +63,13 @@ * sht.readHumidityTicks(&h); * humi_f = (float)(h); * rh_lin = C3 * humi_f * humi_f + C2 * humi_f + C1; -* rh_true=(((tv[a]/100)-25)*(T1+T2*humi_f)+rh_lin); +* rh_true=(((temperature/100)-25)*(T1+T2*humi_f)+rh_lin); * if(rh_true>100)rh_true=100; //cut if the value is outside * if(rh_true<1)rh_true=1; //the physical possible range -* huididty = rh_true; +* humidity = rh_true; * pc.printf("Temp: %2.2f RH %2.2f\n\r",temperature, humidity); * } * } -* } * @endcode */