jim hamblen
/
PowerSwitchTail
Simple Demo of PowerSwitch Tail module used to control AC devices
main.cpp@0:16d630ef7d39, 2014-10-22 (annotated)
- Committer:
- 4180_1
- Date:
- Wed Oct 22 16:58:14 2014 +0000
- Revision:
- 0:16d630ef7d39
ver 1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
4180_1 | 0:16d630ef7d39 | 1 | #include "mbed.h" |
4180_1 | 0:16d630ef7d39 | 2 | |
4180_1 | 0:16d630ef7d39 | 3 | DigitalOut myled(LED1); |
4180_1 | 0:16d630ef7d39 | 4 | DigitalOut Ctrl(p8); |
4180_1 | 0:16d630ef7d39 | 5 | |
4180_1 | 0:16d630ef7d39 | 6 | int main() { |
4180_1 | 0:16d630ef7d39 | 7 | while(1) { |
4180_1 | 0:16d630ef7d39 | 8 | Ctrl = 1; |
4180_1 | 0:16d630ef7d39 | 9 | myled = 1; |
4180_1 | 0:16d630ef7d39 | 10 | wait(2); |
4180_1 | 0:16d630ef7d39 | 11 | Ctrl = 0; |
4180_1 | 0:16d630ef7d39 | 12 | myled = 0; |
4180_1 | 0:16d630ef7d39 | 13 | wait(2); |
4180_1 | 0:16d630ef7d39 | 14 | } |
4180_1 | 0:16d630ef7d39 | 15 | } |