NXP-Japan Demo-0
/
test_LM75B_Hello
pull request test
Fork of test_LM75B_Hello by
main.cpp@3:863cf79582a4, 2014-11-03 (annotated)
- Committer:
- okano
- Date:
- Mon Nov 03 00:15:27 2014 +0000
- Revision:
- 3:863cf79582a4
- Parent:
- 2:482581f76a1d
- Child:
- 6:b57b9dcfb515
modification on constructor : taking an I2C object
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:f947ed831c67 | 1 | #include "mbed.h" |
okano | 1:3c29c04cfeb2 | 2 | #include "test_LM75B.h" |
okano | 0:f947ed831c67 | 3 | |
okano | 3:863cf79582a4 | 4 | I2C i2c( p28, p27 ); |
okano | 3:863cf79582a4 | 5 | test_LM75B temp( i2c ); |
okano | 0:f947ed831c67 | 6 | |
okano | 0:f947ed831c67 | 7 | int main() |
okano | 0:f947ed831c67 | 8 | { |
okano | 2:482581f76a1d | 9 | float t; |
okano | 2:482581f76a1d | 10 | |
okano | 3:863cf79582a4 | 11 | i2c.frequency( 400 * 1000 ); |
okano | 3:863cf79582a4 | 12 | |
okano | 0:f947ed831c67 | 13 | while(1) { |
okano | 2:482581f76a1d | 14 | t = temp; |
okano | 2:482581f76a1d | 15 | printf( "temp = %7.3f\r\n", t ); |
okano | 0:f947ed831c67 | 16 | wait( 1 ); |
okano | 0:f947ed831c67 | 17 | } |
okano | 0:f947ed831c67 | 18 | } |
okano | 0:f947ed831c67 | 19 |