example project to explain how to write a class library

Dependencies:   mbed test_LM75B

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /** Hello code for "test_LM75B" */
00002 
00003 #include "mbed.h"
00004 #include "test_LM75B.h"
00005 
00006 test_LM75B  temp0( p28, p27 );
00007 
00008 I2C         i2c( p28, p27 );
00009 test_LM75B  temp1( i2c );
00010 
00011 
00012 int main()
00013 {
00014     float   t0;
00015     float   t1;
00016 
00017     i2c.frequency( 400 * 1000 );
00018 
00019     while(1) {
00020         t0   = temp0;
00021         t1   = temp1;
00022         printf( "temp = %7.3f, %7.3f\r\n", t0, t1 );
00023         wait( 1 );
00024     }
00025 }