![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Proyect for Digital Electronics II
Main/main.cpp@1:31d8b73f51e6, 2019-07-06 (annotated)
- Committer:
- junmorenodi
- Date:
- Sat Jul 06 23:35:51 2019 +0000
- Revision:
- 1:31d8b73f51e6
- Parent:
- 0:8e048063034d
- Child:
- 2:2a51bb467d8d
hola;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
junmorenodi | 0:8e048063034d | 1 | #include "mbed.h" |
junmorenodi | 0:8e048063034d | 2 | #include "BH1750.h" |
junmorenodi | 0:8e048063034d | 3 | |
junmorenodi | 1:31d8b73f51e6 | 4 | |
junmorenodi | 0:8e048063034d | 5 | //BH1750 lightSensor(I2C_SDA, I2C_SCL); |
junmorenodi | 0:8e048063034d | 6 | BH1750 lightSensor(PB_9, PB_8); |
junmorenodi | 0:8e048063034d | 7 | Serial pc(SERIAL_TX, SERIAL_RX); |
junmorenodi | 0:8e048063034d | 8 | |
junmorenodi | 0:8e048063034d | 9 | int main() |
junmorenodi | 0:8e048063034d | 10 | { |
junmorenodi | 0:8e048063034d | 11 | lightSensor.init(); |
junmorenodi | 1:31d8b73f51e6 | 12 | |
junmorenodi | 0:8e048063034d | 13 | |
junmorenodi | 1:31d8b73f51e6 | 14 | |
junmorenodi | 0:8e048063034d | 15 | while(1) { |
junmorenodi | 0:8e048063034d | 16 | pc.printf("Light intensity: %.4f Lux\r\n", lightSensor.readIntesity()); |
junmorenodi | 1:31d8b73f51e6 | 17 | wait(3); |
junmorenodi | 0:8e048063034d | 18 | } |
junmorenodi | 0:8e048063034d | 19 | } |