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: mbed 4DGL-uLCD-SE mbed-rtos nRF24L01P
Speaker.h@33:5d86c111d9bc, 2018-04-25 (annotated)
- Committer:
- Nurchu
- Date:
- Wed Apr 25 15:39:03 2018 +0000
- Revision:
- 33:5d86c111d9bc
- Parent:
- 20:e068469ffb89
- Child:
- 49:8ae98a6d48c0
Fixed a few bugs
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Nurchu | 12:efcfe4c0d9f2 | 1 | #include "mbed.h" |
| Nurchu | 12:efcfe4c0d9f2 | 2 | |
| Nurchu | 12:efcfe4c0d9f2 | 3 | class Speaker { |
| Nurchu | 12:efcfe4c0d9f2 | 4 | public: |
| Nurchu | 12:efcfe4c0d9f2 | 5 | Speaker(PinName pin); |
| Nurchu | 20:e068469ffb89 | 6 | |
| Nurchu | 33:5d86c111d9bc | 7 | void rawWrite(float value); |
| Nurchu | 33:5d86c111d9bc | 8 | |
| Nurchu | 20:e068469ffb89 | 9 | // Writes a scaled uint8_t from RF transmission to the speaker |
| Nurchu | 14:4637a9f02919 | 10 | void write(uint8_t value); |
| Nurchu | 12:efcfe4c0d9f2 | 11 | |
| Nurchu | 20:e068469ffb89 | 12 | // Writes 0 to the analogOut to completely turn off the speaker |
| Nurchu | 20:e068469ffb89 | 13 | void turnOff(); |
| Nurchu | 20:e068469ffb89 | 14 | |
| Nurchu | 12:efcfe4c0d9f2 | 15 | private: |
| Nurchu | 17:604f9c4bd6d3 | 16 | AnalogOut _pin; |
| Nurchu | 14:4637a9f02919 | 17 | float dc; |
| Nurchu | 12:efcfe4c0d9f2 | 18 | }; |