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 CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
CANController/DC_DC/DC_DC.cpp@24:f58a3c0071c3, 2014-11-07 (annotated)
- Committer:
- martydd3
- Date:
- Fri Nov 07 21:26:46 2014 +0000
- Revision:
- 24:f58a3c0071c3
- Parent:
- 22:fc802e7715f8
finally compiles
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| martydd3 | 22:fc802e7715f8 | 1 | #include "mbed.h" |
| martydd3 | 22:fc802e7715f8 | 2 | #include "DC_DC.h" |
| martydd3 | 22:fc802e7715f8 | 3 | |
| martydd3 | 22:fc802e7715f8 | 4 | DigitalOut dc_pin(p20); |
| martydd3 | 22:fc802e7715f8 | 5 | DigitalOut dc_control(p18); |
| martydd3 | 22:fc802e7715f8 | 6 | |
| martydd3 | 22:fc802e7715f8 | 7 | #define OFF 1 |
| martydd3 | 22:fc802e7715f8 | 8 | #define ON 0 |
| martydd3 | 22:fc802e7715f8 | 9 | |
| martydd3 | 22:fc802e7715f8 | 10 | DC::DC(){ |
| martydd3 | 22:fc802e7715f8 | 11 | dc_control = OFF; |
| martydd3 | 22:fc802e7715f8 | 12 | } |
| martydd3 | 22:fc802e7715f8 | 13 | |
| martydd3 | 22:fc802e7715f8 | 14 | bool DC::is_on(){ |
| martydd3 | 22:fc802e7715f8 | 15 | return dc_pin; |
| martydd3 | 22:fc802e7715f8 | 16 | } |
| martydd3 | 22:fc802e7715f8 | 17 | |
| martydd3 | 22:fc802e7715f8 | 18 | void DC::set(bool s){ |
| martydd3 | 22:fc802e7715f8 | 19 | if(s) |
| martydd3 | 22:fc802e7715f8 | 20 | dc_control = ON; |
| martydd3 | 22:fc802e7715f8 | 21 | else |
| martydd3 | 22:fc802e7715f8 | 22 | dc_control = OFF; |
| martydd3 | 22:fc802e7715f8 | 23 | } |
