Hello world code for PCT2075 and LM75B component class library. The PCT2075 is a temperature-to-digital converter featuring +/-1 degree-C accuracy over -25 degree-C to +100 degree-C range. It uses an on-chip band gap temperature sensor and Sigma-Delta A-to-D conversion technique with an overtemperature detection output that is a drop-in replacement for other LM75 series thermal sensors.

Dependencies:   PCT2075 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /** Hello code for "PCT2075" and "LM75B" */
00002 
00003 #include "mbed.h"
00004 #include "PCT2075.h"
00005 //#include "LM75B.h"
00006 
00007 PCT2075 temp_sensor( p28, p27 );
00008 //LM75B temp_sensor( p28, p27 );
00009 
00010 int main()
00011 {
00012     while(1) {
00013         printf( "temp = %7.3f\r\n", (float)temp_sensor );
00014         wait( 1 );
00015     }
00016 }