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.
Diff: edge_utils/edge_mgr.cpp
- Revision:
- 3:cac964851bb6
- Parent:
- 2:778a4d4436ff
- Child:
- 7:aa858d789025
--- a/edge_utils/edge_mgr.cpp Sun Dec 03 23:58:11 2017 +0000
+++ b/edge_utils/edge_mgr.cpp Mon Dec 04 02:47:38 2017 +0000
@@ -36,7 +36,7 @@
I2C *edge_i2c0 = 0 ;
I2C *edge_i2c1 = 0 ;
-SO1602A *so1602a = 0 ; /* OLED display on I2C */
+SO1602A *display = 0 ; /* OLED display on I2C */
MMA8451Q *mma8451q = 0 ;
VEML6040 *veml6040[2] = { 0, 0 } ;
LM75B *lm75b0 = 0 ; /* for temp1 */
@@ -59,6 +59,13 @@
enable_sensors() ;
first_loop = 0 ;
printf("Sensor loop started!\n") ;
+ if (display) {
+ display->clearDisplay() ;
+ display->locate(0, 0) ;
+ display->putStr("Sensor Loop") ;
+ display->locate(0, 1) ;
+ display->putStr(" Started! ") ;
+ }
}
switch(sensor_index) {
case 0: /* accel */
@@ -175,20 +182,19 @@
if (is_present(edge_i2c0, SO1602A_I2C_ADDRESS)) {
printf("SO1602A on I2C0 is present\n") ;
- so1602a = new SO1602A(edge_i2c0, SO1602A_I2C_ADDRESS) ;
+ display = new SO1602A(edge_i2c0, SO1602A_I2C_ADDRESS) ;
} else if (is_present(edge_i2c1, SO1602A_I2C_ADDRESS)) {
printf("SO1602A on I2C1 is present\n") ;
- so1602a = new SO1602A(edge_i2c1, SO1602A_I2C_ADDRESS) ;
+ display = new SO1602A(edge_i2c1, SO1602A_I2C_ADDRESS) ;
} else {
printf("SO1602A is absent\n") ;
}
- if (so1602a) {
- so1602a->clearDisplay() ;
- so1602a->locate(3, 0) ;
- so1602a->putStr("Suntory") ;
- so1602a->locate(0, 1) ;
- so1602a->putStr("Server Monitor") ;
-
+ if (display) {
+ display->clearDisplay() ;
+ display->locate(3, 0) ;
+ display->putStr("Suntory") ;
+ display->locate(0, 1) ;
+ display->putStr("Server Monitor") ;
}
if (is_present(edge_i2c1, MMA8451Q_I2C_ADDRESS)) {
@@ -270,6 +276,14 @@
#endif
if (num_sensor > 0) {
printf("%d edge_sensor(s) registered\n", num_sensor) ;
+ printf("Edge is waiting for ASR to link\n") ;
+ if (display) {
+ display->clearDisplay() ;
+ display->locate(0, 0) ;
+ display->putStr("Waiting for") ;
+ display->locate(0, 1) ;
+ display->putStr("ASR to Link") ;
+ }
}
}