Tedd OKANO
/
test_LM75B_Hello
example project to explain how to write a class library
Embed:
(wiki syntax)
Show/hide line numbers
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 }
Generated on Tue Nov 14 2023 21:43:14 by 1.7.2