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
io/DeviceFeedback.h@71:063c45e99578, 2015-02-16 (annotated)
- Committer:
- xinlei
- Date:
- Mon Feb 16 09:17:30 2015 +0000
- Revision:
- 71:063c45e99578
- Parent:
- 67:c360a2b2c948
- Child:
- 90:423177e8a401
Various minor bug fixes
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| vwochnik | 65:a62dbef2f924 | 1 | #ifndef DEVICEFEEDBACK_H |
| vwochnik | 65:a62dbef2f924 | 2 | #define DEVICEFEEDBACK_H |
| vwochnik | 65:a62dbef2f924 | 3 | |
| vwochnik | 65:a62dbef2f924 | 4 | #include <stddef.h> |
| vwochnik | 65:a62dbef2f924 | 5 | #include "mbed.h" |
| vwochnik | 65:a62dbef2f924 | 6 | #include "rtos.h" |
| vwochnik | 65:a62dbef2f924 | 7 | |
| vwochnik | 65:a62dbef2f924 | 8 | class DeviceFeedback |
| vwochnik | 65:a62dbef2f924 | 9 | { |
| vwochnik | 65:a62dbef2f924 | 10 | public: |
| vwochnik | 65:a62dbef2f924 | 11 | DeviceFeedback(PwmOut speaker); |
| vwochnik | 65:a62dbef2f924 | 12 | |
| vwochnik | 67:c360a2b2c948 | 13 | void beepSuccess(); |
| vwochnik | 67:c360a2b2c948 | 14 | void beepFailure(); |
| vwochnik | 65:a62dbef2f924 | 15 | void closeRelay(); |
| vwochnik | 65:a62dbef2f924 | 16 | void openRelay(); |
| vwochnik | 65:a62dbef2f924 | 17 | |
| vwochnik | 65:a62dbef2f924 | 18 | protected: |
| vwochnik | 67:c360a2b2c948 | 19 | void sendMessage(uint8_t); |
| vwochnik | 65:a62dbef2f924 | 20 | void thread(); |
| vwochnik | 65:a62dbef2f924 | 21 | static void thread_func(void const*); |
| vwochnik | 65:a62dbef2f924 | 22 | |
| vwochnik | 65:a62dbef2f924 | 23 | private: |
| vwochnik | 65:a62dbef2f924 | 24 | PwmOut _speaker; |
| vwochnik | 65:a62dbef2f924 | 25 | Thread _thread; |
| xinlei | 71:063c45e99578 | 26 | |
| xinlei | 71:063c45e99578 | 27 | /* LED lights on the application shield, consists of three colors: Red, Blue, Green. |
| xinlei | 71:063c45e99578 | 28 | * Note: value 0 means fully on for a color, 255 means off. |
| xinlei | 71:063c45e99578 | 29 | */ |
| xinlei | 71:063c45e99578 | 30 | DigitalOut shieldLEDRed; |
| xinlei | 71:063c45e99578 | 31 | DigitalOut shieldLEDBlue; |
| xinlei | 71:063c45e99578 | 32 | DigitalOut shieldLEDGreen; |
| vwochnik | 65:a62dbef2f924 | 33 | Mail<uint8_t, 16> _mail; |
| vwochnik | 65:a62dbef2f924 | 34 | }; |
| vwochnik | 65:a62dbef2f924 | 35 | |
| vwochnik | 65:a62dbef2f924 | 36 | #endif |
