yoshinari kou
/
LCD_T_H_C
White Wizard Board LCD show you Direction, Temperature & Humidity.
Revision 0:c52bbcb5d520, committed 2011-08-24
- Comitter:
- halfpitch
- Date:
- Wed Aug 24 05:23:54 2011 +0000
- Commit message:
- Rev.A
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HMC6352.lib Wed Aug 24 05:23:54 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aberk/code/HMC6352/#83c0cb554099
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 24 05:23:54 2011 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "HMC6352.h" + +HMC6352 compass(p28,p27); +TextLCD lcd(p6, p7, p8, p9, p10, p11, p12);//Connect LCD module from p5 to p12. +AnalogIn ad_h(p19); +AnalogIn ad_t(p20); + +int main() { + + float H_data, T_data; + float C_data; + + lcd.cls(); + lcd.printf("White Wizard"); + + //Continuous mode, periodic set/reset, 20Hz measurement rate. + compass.setOpMode(HMC6352_CONTINUOUS, 1, 20); + + wait(3); + + lcd.cls(); + + while(1){ + C_data = compass.sample(); + T_data = ad_t.read() * 3.3; + T_data = 100.0 * (T_data - 0.5); + + H_data = ad_h.read() * 3.3; + H_data = (80.0 / 1.4) * (H_data - 0.6); + + lcd.cls(); + lcd.printf("C:%d T:%d H:%d", (int)(C_data/10.0), (int)T_data, (int)H_data); + wait(1); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Aug 24 05:23:54 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da