Lab4-00_measure_temperature_lite
Dependencies: mbed HEPTA_SENSOR_lite HEPTA_EPS_lite
main.cpp@2:0d5b50471a29, 2021-08-20 (annotated)
- Committer:
- heptasat2021
- Date:
- Fri Aug 20 12:29:35 2021 +0000
- Revision:
- 2:0d5b50471a29
- Parent:
- 1:ddac5ec89167
For Hepta-Sat Lite
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heptasat2021 | 0:da0f6aca15b8 | 1 | #include "mbed.h" |
heptasat2021 | 2:0d5b50471a29 | 2 | #include "HEPTA_EPS.h" |
heptasat2021 | 2:0d5b50471a29 | 3 | #include "HEPTA_SENSOR.h" |
heptasat2021 | 2:0d5b50471a29 | 4 | HEPTA_EPS eps(PA_0,PA_4); |
heptasat2021 | 2:0d5b50471a29 | 5 | HEPTA_SENSOR sensor(PA_7,PB_7,PB_6,0xD0); |
heptasat2021 | 0:da0f6aca15b8 | 6 | Serial pc(USBTX,USBRX,9600); |
heptasat2021 | 0:da0f6aca15b8 | 7 | int main() |
heptasat2021 | 2:0d5b50471a29 | 8 | { |
heptasat2021 | 2:0d5b50471a29 | 9 | float temp; |
heptasat2021 | 2:0d5b50471a29 | 10 | pc.printf("Temperature Sensor\r\n"); |
heptasat2021 | 2:0d5b50471a29 | 11 | eps.turn_on_regulator(); //Turn on 3.3V converter |
heptasat2021 | 2:0d5b50471a29 | 12 | for(int i=0;i<10;i++){ |
heptasat2021 | 2:0d5b50471a29 | 13 | sensor.temp_sense(&temp); |
heptasat2021 | 2:0d5b50471a29 | 14 | pc.printf("Temperature=%f[degC]\r\n",temp); |
heptasat2021 | 2:0d5b50471a29 | 15 | wait_ms(1000); |
heptasat2021 | 0:da0f6aca15b8 | 16 | } |
heptasat2021 | 0:da0f6aca15b8 | 17 | } |