From 31361b9ce2d1d2d2841b7b956907be8e0dead0aa Mon Sep 17 00:00:00 2001 From: Greg Retkowski Date: Thu, 7 Jul 2016 09:34:21 -0700 Subject: [PATCH 1/2] add send_beacon to header file --- PowerFunctions.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PowerFunctions.h b/PowerFunctions.h index 1e4deb3..9b70413 100644 --- a/PowerFunctions.h +++ b/PowerFunctions.h @@ -63,6 +63,7 @@ class PowerFunctions void red_pwm(uint8_t); void blue_pwm(uint8_t); void combo_pwm(uint8_t, uint8_t); + void send_beacon(); private: void pause(uint8_t); @@ -76,4 +77,4 @@ class PowerFunctions }; #endif -// END OF FILE \ No newline at end of file +// END OF FILE From d4193c6ba64306776bcaa885184208b4ce4fe01b Mon Sep 17 00:00:00 2001 From: Greg Retkowski Date: Thu, 7 Jul 2016 09:36:51 -0700 Subject: [PATCH 2/2] added send_becon function Added a function to send beacon messages, to be used with the EV3 IR sensor --- PowerFunctions.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PowerFunctions.cpp b/PowerFunctions.cpp index e4237fb..5c8f648 100644 --- a/PowerFunctions.cpp +++ b/PowerFunctions.cpp @@ -59,6 +59,14 @@ void PowerFunctions::combo_pwm(uint8_t blue_speed, uint8_t red_speed) send(); } +void PowerFunctions::send_beacon() +{ + _nib1 = ESCAPE | _channel; + _nib2 = 0x0; + _nib3 = 0x0; + send(); +} + // // Private methods // @@ -109,4 +117,4 @@ void PowerFunctions::send() } start_stop_bit(); } -} \ No newline at end of file +}