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.
Fork of Seeed_Grove_Shield_Light_Sensor by
Revision 1:d10e08a99894, committed 2014-07-29
- Comitter:
- screamer
- Date:
- Tue Jul 29 13:43:06 2014 +0000
- Parent:
- 0:5ff78d2c85d1
- Child:
- 2:76004e9cf0cc
- Commit message:
- Add raw reading to displayed data
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jul 29 13:23:29 2014 +0000
+++ b/main.cpp Tue Jul 29 13:43:06 2014 +0000
@@ -24,8 +24,10 @@
Serial pc(USBTX, USBRX);
int main() {
+ float val;
while(1) {
- printf("Sensor reading: %f\r\n", (float)(1023-sensor)*10/sensor);
+ val = sensor.read();
+ printf("Sensor reading: %f - %f\r\n", val, (float)(1023-val)*10/val);
myled = !myled;
wait(0.5);
}
