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.
Ka.h@2:14bfd1fc2163, 2018-01-21 (annotated)
- Committer:
- Kaniiii
- Date:
- Sun Jan 21 21:59:04 2018 +0000
- Revision:
- 2:14bfd1fc2163
- Parent:
- 0:2270b7a3a8ad
Library for manipulating led light (includes a main with examples of how to use the program)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kaniiii | 0:2270b7a3a8ad | 1 | #ifndef Ka_FILE |
| Kaniiii | 0:2270b7a3a8ad | 2 | #define Ka_FILE |
| Kaniiii | 2:14bfd1fc2163 | 3 | #include "mbed.h" |
| Kaniiii | 0:2270b7a3a8ad | 4 | |
| Kaniiii | 2:14bfd1fc2163 | 5 | /** My led class. |
| Kaniiii | 2:14bfd1fc2163 | 6 | * Used for manipulating led light on the EFM32 Happy Gecko |
| Kaniiii | 2:14bfd1fc2163 | 7 | * |
| Kaniiii | 2:14bfd1fc2163 | 8 | * Example: Setting the led ON |
| Kaniiii | 2:14bfd1fc2163 | 9 | * @code |
| Kaniiii | 2:14bfd1fc2163 | 10 | * #include "mbed.h" |
| Kaniiii | 2:14bfd1fc2163 | 11 | * #include "Ka.h" |
| Kaniiii | 2:14bfd1fc2163 | 12 | * |
| Kaniiii | 2:14bfd1fc2163 | 13 | * int main() { |
| Kaniiii | 2:14bfd1fc2163 | 14 | * Ka obj; |
| Kaniiii | 2:14bfd1fc2163 | 15 | * obj.set_led0(); |
| Kaniiii | 2:14bfd1fc2163 | 16 | * } |
| Kaniiii | 2:14bfd1fc2163 | 17 | * @endcode |
| Kaniiii | 2:14bfd1fc2163 | 18 | */ |
| Kaniiii | 0:2270b7a3a8ad | 19 | class Ka{ |
| Kaniiii | 0:2270b7a3a8ad | 20 | public : |
| Kaniiii | 0:2270b7a3a8ad | 21 | /** Constructor binds a object made from the Ka class to digitalout from mbed library |
| Kaniiii | 0:2270b7a3a8ad | 22 | */ |
| Kaniiii | 0:2270b7a3a8ad | 23 | Ka(); |
| Kaniiii | 0:2270b7a3a8ad | 24 | /** Function for setting led0 to "on" */ |
| Kaniiii | 0:2270b7a3a8ad | 25 | void set_led0(); |
| Kaniiii | 0:2270b7a3a8ad | 26 | /** Function for setting led0 to "off" */ |
| Kaniiii | 0:2270b7a3a8ad | 27 | void clear_led0(); |
| Kaniiii | 0:2270b7a3a8ad | 28 | /** Function for inverting led0 (on to off, off to on) */ |
| Kaniiii | 0:2270b7a3a8ad | 29 | void invert(); |
| Kaniiii | 2:14bfd1fc2163 | 30 | /** Function for making led0 blink. Takes amount of blink seconds as parameter*/ |
| Kaniiii | 2:14bfd1fc2163 | 31 | void blinker (int a); |
| Kaniiii | 0:2270b7a3a8ad | 32 | |
| Kaniiii | 0:2270b7a3a8ad | 33 | private: |
| Kaniiii | 0:2270b7a3a8ad | 34 | DigitalOut m; |
| Kaniiii | 0:2270b7a3a8ad | 35 | |
| Kaniiii | 0:2270b7a3a8ad | 36 | |
| Kaniiii | 0:2270b7a3a8ad | 37 | }; |
| Kaniiii | 0:2270b7a3a8ad | 38 | |
| Kaniiii | 0:2270b7a3a8ad | 39 | #endif |