lib for realteimMM funcs
Revision 4:af34fda1dfb0, committed 2018-02-16
- Comitter:
- GTNicholson
- Date:
- Fri Feb 16 09:58:02 2018 +0000
- Parent:
- 3:13301255d95a
- Parent:
- 2:ed0430db9b2b
- Child:
- 5:3906f93b8b39
- Commit message:
- Merging In ThermoCouples
Changed in this revision
--- 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
--- a/MBedStation.h Thu Feb 15 16:35:50 2018 +0000 +++ b/MBedStation.h Fri Feb 16 09:58:02 2018 +0000 @@ -2,6 +2,7 @@ #include "sensor_base.h" #include <iostream> #include <string> +#include "mbed.h" using namespace std; @@ -13,11 +14,17 @@ //sensor_base sensors[]; int test[5]; void setup(); + int ProcessResponse(char * Response); sensor_base sensors[8]; sensor_onoff sensor_0; sensor_vin sensor_1; sensor_vin sensor_2; + //sensor_pulse sensor_3; //sensor_max6675 sensor_4; //sensor_max6675 sensor_5; + + DigitalOut light_1; + DigitalOut light_2; + }; \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MBedStation.h.orig Fri Feb 16 09:58:02 2018 +0000 @@ -0,0 +1,23 @@ + +#include "sensor_base.h" +#include <iostream> +#include <string> + +using namespace std; + +class MBedStation +{ + public: + MBedStation(); + string name; + //sensor_base sensors[]; + int test[5]; + void setup(); + sensor_base sensors[8]; + sensor_onoff sensor_0; + sensor_vin sensor_1; + sensor_vin sensor_2; + //sensor_pulse sensor_3; + //sensor_max6675 sensor_4; + //sensor_max6675 sensor_5; +}; \ No newline at end of file