lib for realteimMM funcs
Diff: MBedStation.cpp
- Revision:
- 4:af34fda1dfb0
- Parent:
- 3:13301255d95a
- Parent:
- 2:ed0430db9b2b
- Child:
- 5:3906f93b8b39
--- a/MBedStation.cpp Thu Feb 15 16:35:50 2018 +0000 +++ b/MBedStation.cpp Fri Feb 16 09:58:02 2018 +0000 @@ -5,9 +5,9 @@ #include <cstdint> -MBedStation::MBedStation() +MBedStation::MBedStation() :light_1(p17), light_2(LED4) { - + } //sensor_base MBed::sensors[1] @@ -33,6 +33,12 @@ MBedStation::sensors[2] = sensor2; sensor_2 = sensor2; + DigitalOut light1(p17); + light_1 = light1; + + DigitalOut light2(LED4); + light_2 = light2; + /* sensor_pulse sensor3(p6); sensor3.sensor_id = 4; @@ -56,3 +62,27 @@ */ } + +int MBedStation::ProcessResponse(char * Response) +{ + int led_response; + led_response = atoi(Response); + if (led_response == 1 or led_response == 3) + { + light_1 = 1; + } + else + { + light_1 =0; + } + + if (led_response == 2 or led_response == 3) + { + light_2 = 1; + } + else + { + light_2 =0; + } + return 1; +} \ No newline at end of file