Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: io/DeviceFeedback.cpp
- Revision:
- 93:61d44636f020
- Parent:
- 92:0acd11870c6a
--- a/io/DeviceFeedback.cpp Mon Apr 13 14:24:58 2015 +0000
+++ b/io/DeviceFeedback.cpp Mon Apr 20 15:04:23 2015 +0000
@@ -1,114 +1,19 @@
-#include <stdlib.h>
-#include <string.h>
-#include "DeviceFeedback.h"
-
-#define MSG_BEEP_SUCCESS 1
-#define MSG_BEEP_FAILURE 2
-#define MSG_CLOSE_RELAY 3
-#define MSG_OPEN_RELAY 4
+#include "mbed.h"
-DeviceFeedback::DeviceFeedback() :
-// _speaker(D6),
-// _thread(DeviceFeedback::thread_func, this),
- shieldLEDRed(D5),
- shieldLEDBlue(D8),
- shieldLEDGreen(D9)
-{
- shieldLEDRed = 255;
- shieldLEDBlue = 255;
- shieldLEDGreen = 255;
-}
+DigitalOut shieldLEDRed(D5, 255);
+DigitalOut shieldLEDBlue(D8, 255);
+DigitalOut shieldLEDGreen(D9, 255);
-//void DeviceFeedback::beepSuccess()
-//{
-// sendMessage(MSG_BEEP_SUCCESS);
-//}
-//
-//void DeviceFeedback::beepFailure()
-//{
-// sendMessage(MSG_BEEP_FAILURE);
-//}
-
-void DeviceFeedback::closeRelay()
+void closeRelay()
{
shieldLEDRed = 255;
shieldLEDBlue = 255;
shieldLEDGreen = 0;
-// sendMessage(MSG_CLOSE_RELAY);
}
-void DeviceFeedback::openRelay()
+void openRelay()
{
shieldLEDRed = 255;
shieldLEDBlue = 255;
shieldLEDGreen = 255;
-// sendMessage(MSG_OPEN_RELAY);
-}
-
-//void DeviceFeedback::sendMessage(uint8_t msg)
-//{
-// uint8_t *msgPtr = _mail.alloc();
-// *msgPtr = msg;
-// _mail.put(msgPtr);
-//}
-
-//void DeviceFeedback::thread()
-//{
-// osEvent evt;
-// while (true) {
-// evt = _mail.get();
-// if (evt.status == osEventMail) {
-// uint8_t *msg = (uint8_t*)evt.value.p;
-// uint8_t u = *msg;
-// _mail.free(msg);
-// switch (u) {
-// case MSG_BEEP_SUCCESS:
-// for (float i=2000.0; i<10000.0; i+=2000.0) {
-// _speaker.period(1.0/i);
-// _speaker = 0.5;
-// Thread::wait(200);
-// _speaker = 0.0;
-// Thread::wait(50);
-// }
-// break;
-// case MSG_BEEP_FAILURE:
-// for (float i=10000.0; i>2000.0; i-=2000.0) {
-// _speaker.period(1.0/i);
-// _speaker = 0.5;
-// Thread::wait(200);
-// _speaker = 0.0;
-// Thread::wait(50);
-// }
-// break;
-// case MSG_CLOSE_RELAY:
-// if (!relayState) {
-// for (float i=2000.0; i<10000.0; i+=100) {
-// _speaker.period(1.0/i);
-// _speaker = 0.5;
-// Thread::wait(20);
-// }
-// _speaker = 0.0;
-// }
-// break;
-// case MSG_OPEN_RELAY:
-// if (relayState) {
-// for (float i=10000.0; i>2000.0; i-=100) {
-// _speaker.period(1.0/i);
-// _speaker = 0.5;
-// Thread::wait(20);
-// }
-// _speaker = 0.0;
-// }
-// break;
-// }
-// }
-//
-// }
-//}
-
-//void DeviceFeedback::thread_func(void const *arg)
-//{
-// DeviceFeedback *that;
-// that = (DeviceFeedback*)arg;
-// that->thread();
-//}
+}
\ No newline at end of file
