Dependencies:   dispBoB mbed PCA9635

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers digitalThermometer.cpp Source File

digitalThermometer.cpp

00001 #include "mbed.h"
00002 #include "dispBoB.h"
00003 #include "TMP102.h"
00004 
00005 dispBoB db(p28, p27, p26);          //instantiate a dispBoB object
00006 TMP102 temperature(p9, p10, 0x90);  //instantiate a TMP102 object
00007 
00008 int main() {                   
00009     db.init();     
00010     db.cls();                       //clear screen
00011     while(1){
00012         db.locate(0);               //position to start
00013         db.printf("%f", temperature.read());  //print temperature
00014         db.printf("%c", ".C");      //degrees celsius
00015         wait(1);                    //wait 1 second before looping
00016     }
00017 }