Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@2:dd10c541a3dc, 2016-03-14 (annotated)
- Committer:
- 12104404
- Date:
- Mon Mar 14 03:11:03 2016 +0000
- Revision:
- 2:dd10c541a3dc
- Parent:
- 1:308cc5302475
- Child:
- 3:fecb1929cbef
lux working?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| 12104404 | 0:815555c72774 | 1 | #include "mbed.h" |
| 12104404 | 0:815555c72774 | 2 | #include "TSL2591.h" |
| 12104404 | 0:815555c72774 | 3 | |
| 12104404 | 0:815555c72774 | 4 | I2C i2c1(PB_9, PB_8); |
| 12104404 | 0:815555c72774 | 5 | TSL2591 sensor(i2c1, TSL2591_ADDR); |
| 12104404 | 0:815555c72774 | 6 | |
| 12104404 | 0:815555c72774 | 7 | DigitalOut myled(LED1); |
| 12104404 | 0:815555c72774 | 8 | |
| 12104404 | 0:815555c72774 | 9 | int main() |
| 12104404 | 0:815555c72774 | 10 | { |
| 12104404 | 0:815555c72774 | 11 | sensor.init(); |
| 12104404 | 0:815555c72774 | 12 | while(1) { |
| 12104404 | 0:815555c72774 | 13 | sensor.getALS(); |
| 12104404 | 2:dd10c541a3dc | 14 | sensor.calcLux(); |
| 12104404 | 2:dd10c541a3dc | 15 | printf("%d \t %d \t %d \t %d\n",sensor.full,sensor.ir,sensor.visible,sensor.lux); |
| 12104404 | 2:dd10c541a3dc | 16 | wait(0.5); |
| 12104404 | 0:815555c72774 | 17 | } |
| 12104404 | 0:815555c72774 | 18 | } |