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.
Dependencies: mbed FXOS8700CQ
Revision 29:e6c8bd41caa6, committed 2016-07-16
- Comitter:
- stefanrousseau
- Date:
- Sat Jul 16 17:35:15 2016 +0000
- Parent:
- 28:886833917643
- Child:
- 30:48b43538e98b
- Commit message:
- Changed proximity to value instead of string
Changed in this revision
| sensors.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/sensors.cpp Fri Jul 15 13:17:26 2016 +0000
+++ b/sensors.cpp Sat Jul 16 17:35:15 2016 +0000
@@ -267,25 +267,29 @@
//printf("PS2_Data = %d\n", PS2);
//printf("PS3_Data = %d\n", PS3);
//OBJECT PRESENT?
+#if (0)
if(PS1 < 22000){
//printf("Object Far\n");
- sprintf(SENSOR_DATA.Proximity, "Object Far");
+ sprintf(SENSOR_DATA.Proximity, "Object Far\0");
}
else if(PS1 < 24000)
{
//printf("Object in Vicinity\n");
- sprintf(SENSOR_DATA.Proximity, "Object in Vicinity");
+ sprintf(SENSOR_DATA.Proximity, "Object in Vicinity\0");
}
else if (PS1 < 30000)
{
//printf("Object Near\n");
- sprintf(SENSOR_DATA.Proximity, "Object Near");
+ sprintf(SENSOR_DATA.Proximity, "Object Near\0");
}
else
{
//printf("Object Very Near\n");
- sprintf(SENSOR_DATA.Proximity, "Object Very Near");
+ sprintf(SENSOR_DATA.Proximity, "Object Very Near\0");
}
+#else
+ sprintf(SENSOR_DATA.Proximity, "%d\0", PS1);
+#endif
//Force ALS read:
//WriteTo_Si1145_Register(REG_COMMAND, 0x06);

