Einstein Filho
/
MLX90614
Mangue Baja Personalized MLX program
main.cpp@2:5e50e3dd1d17, 2019-08-01 (annotated)
- Committer:
- einsteingustavo
- Date:
- Thu Aug 01 11:43:08 2019 +0000
- Revision:
- 2:5e50e3dd1d17
- Parent:
- 1:494ed2723916
Mangue Baja Personalized MLX program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
einsteingustavo | 1:494ed2723916 | 1 | #include "mbed.h" |
einsteingustavo | 1:494ed2723916 | 2 | #include "my_mlx.h" |
einsteingustavo | 1:494ed2723916 | 3 | |
einsteingustavo | 1:494ed2723916 | 4 | I2C i2c(PB_9, PB_8); //I2C_SDA, I2C_SCL |
einsteingustavo | 1:494ed2723916 | 5 | Adafruit_MLX90614 mlx(&i2c); |
einsteingustavo | 1:494ed2723916 | 6 | Serial pc(PA_2, PA_3, 115200); |
einsteingustavo | 1:494ed2723916 | 7 | |
einsteingustavo | 1:494ed2723916 | 8 | float temp; |
einsteingustavo | 1:494ed2723916 | 9 | int select; // 0 = object temp, 1 = ambient temp |
einsteingustavo | 1:494ed2723916 | 10 | |
einsteingustavo | 1:494ed2723916 | 11 | int main(){ |
einsteingustavo | 1:494ed2723916 | 12 | while(true){ |
einsteingustavo | 1:494ed2723916 | 13 | temp=mlx.readAmbientTempC(); |
einsteingustavo | 1:494ed2723916 | 14 | pc.printf("%4.2f Celcius\r\n", temp); |
einsteingustavo | 1:494ed2723916 | 15 | wait(1); |
einsteingustavo | 1:494ed2723916 | 16 | } |
einsteingustavo | 1:494ed2723916 | 17 | } |