Red Light Work
Fork of realtimeMMLib by
Diff: MBedStation.cpp
- Revision:
- 1:b80e5f26b233
- Parent:
- 0:9f82ee1feae7
- Child:
- 2:ed0430db9b2b
--- a/MBedStation.cpp Mon Oct 02 11:18:47 2017 +0000 +++ b/MBedStation.cpp Mon Oct 02 15:24:52 2017 +0000 @@ -5,9 +5,9 @@ #include <cstdint> -MBedStation::MBedStation() +MBedStation::MBedStation() :light_1(LED2), light_2(LED4) { - + } //sensor_base MBed::sensors[1] @@ -33,6 +33,12 @@ MBedStation::sensors[2] = sensor2; sensor_2 = sensor2; + DigitalOut light1(LED2); + light_1 = light1; + + DigitalOut light2(LED4); + light_2 = light2; + /* sensor_pulse sensor3(p6); sensor3.sensor_id = 4; @@ -41,3 +47,27 @@ sensor_3 = sensor3; */ } + +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