![](/media/cache/group/MFR16-new.png.50x50_q85.jpg)
Sweep a servo according to Proximity sensor measure
Dependencies: Servo X_NUCLEO_6180XA1 mbed
Fork of HelloWorld_6180XA1 by
Diff: main.cpp
- Revision:
- 24:018a59122fe3
- Parent:
- 23:9085260d2902
- Child:
- 25:2c4710283e02
--- a/main.cpp Mon Nov 02 15:45:36 2015 +0000 +++ b/main.cpp Tue Nov 03 07:56:58 2015 +0000 @@ -61,11 +61,11 @@ sprintf(str,"%d",data_sensor_top.range_mm); board->display->DisplayString(str, strlen(str)); } - /*else + else { - sprintf(str,"%s","----"); + sprintf(str,"%s","---"); board->display->DisplayString(str, strlen(str)); - }*/ + } } else if(op_mode==als_continuous_interrupt) { @@ -74,11 +74,11 @@ sprintf(str,"%d",data_sensor_top.lux); board->display->DisplayString(str, strlen(str)); } - /*else + else { - sprintf(str,"%s","----"); + sprintf(str,"%s","---"); board->display->DisplayString(str, strlen(str)); - }*/ + } } } @@ -91,6 +91,7 @@ int status, measure; char str[4]; + //device_i2c.frequency(400000); //change i2c frequncy from 100kHz to 400kHz pc.baud(115200); //change the printf baudrate status=board->InitBoard();