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@20:e068469ffb89, 2018-04-20 (annotated)
- Committer:
- Nurchu
- Date:
- Fri Apr 20 18:39:20 2018 +0000
- Revision:
- 20:e068469ffb89
- Parent:
- 17:604f9c4bd6d3
- Child:
- 33:5d86c111d9bc
Cleaned up some comments/code; Compiles now
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 | 20:e068469ffb89 | 7 | // Writes a scaled uint8_t from RF transmission to the speaker |
Nurchu | 14:4637a9f02919 | 8 | void write(uint8_t value); |
Nurchu | 12:efcfe4c0d9f2 | 9 | |
Nurchu | 20:e068469ffb89 | 10 | // Writes 0 to the analogOut to completely turn off the speaker |
Nurchu | 20:e068469ffb89 | 11 | void turnOff(); |
Nurchu | 20:e068469ffb89 | 12 | |
Nurchu | 12:efcfe4c0d9f2 | 13 | private: |
Nurchu | 17:604f9c4bd6d3 | 14 | AnalogOut _pin; |
Nurchu | 14:4637a9f02919 | 15 | float dc; |
Nurchu | 12:efcfe4c0d9f2 | 16 | }; |