![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
nakagawa kit emurator (add CR) BaudRate 115200,p20
Dependencies: mbed NetServicesMin
common/leds.cpp@0:e5342390978b, 2012-03-22 (annotated)
- Committer:
- recotana
- Date:
- Thu Mar 22 14:35:48 2012 +0000
- Revision:
- 0:e5342390978b
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
recotana | 0:e5342390978b | 1 | #include "mbed.h" |
recotana | 0:e5342390978b | 2 | #include "leds.h" |
recotana | 0:e5342390978b | 3 | |
recotana | 0:e5342390978b | 4 | Timeout led_ether; |
recotana | 0:e5342390978b | 5 | Timeout led_xbee; |
recotana | 0:e5342390978b | 6 | Timeout led_device; |
recotana | 0:e5342390978b | 7 | |
recotana | 0:e5342390978b | 8 | DigitalOut ledXb(LED1); |
recotana | 0:e5342390978b | 9 | DigitalOut ledDev(LED2); |
recotana | 0:e5342390978b | 10 | DigitalOut ledTcpCon(LED3); |
recotana | 0:e5342390978b | 11 | DigitalOut ledEt(LED4); |
recotana | 0:e5342390978b | 12 | |
recotana | 0:e5342390978b | 13 | void offEther(void){ |
recotana | 0:e5342390978b | 14 | ledEt=0; |
recotana | 0:e5342390978b | 15 | } |
recotana | 0:e5342390978b | 16 | void offXBee(void){ |
recotana | 0:e5342390978b | 17 | ledXb=0; |
recotana | 0:e5342390978b | 18 | } |
recotana | 0:e5342390978b | 19 | void offDevice(void){ |
recotana | 0:e5342390978b | 20 | ledDev=0; |
recotana | 0:e5342390978b | 21 | } |
recotana | 0:e5342390978b | 22 | |
recotana | 0:e5342390978b | 23 | void ledEther(void) |
recotana | 0:e5342390978b | 24 | { |
recotana | 0:e5342390978b | 25 | ledEt=1; |
recotana | 0:e5342390978b | 26 | led_ether.attach(&offEther,kLedOnTime); |
recotana | 0:e5342390978b | 27 | } |
recotana | 0:e5342390978b | 28 | void ledXBee(void) |
recotana | 0:e5342390978b | 29 | { |
recotana | 0:e5342390978b | 30 | ledXb=1; |
recotana | 0:e5342390978b | 31 | led_xbee.attach(&offXBee,kLedOnTime); |
recotana | 0:e5342390978b | 32 | } |
recotana | 0:e5342390978b | 33 | void ledDevice(void) |
recotana | 0:e5342390978b | 34 | { |
recotana | 0:e5342390978b | 35 | ledDev=1; |
recotana | 0:e5342390978b | 36 | led_device.attach(&offDevice,kLedOnTime); |
recotana | 0:e5342390978b | 37 | } |
recotana | 0:e5342390978b | 38 | void onLedDevice(void) |
recotana | 0:e5342390978b | 39 | { |
recotana | 0:e5342390978b | 40 | ledDev=1; |
recotana | 0:e5342390978b | 41 | } |
recotana | 0:e5342390978b | 42 | |
recotana | 0:e5342390978b | 43 | void ledTcpConnect(bool isConnect) |
recotana | 0:e5342390978b | 44 | { |
recotana | 0:e5342390978b | 45 | if(isConnect) ledTcpCon=1; |
recotana | 0:e5342390978b | 46 | else ledTcpCon=0; |
recotana | 0:e5342390978b | 47 | } |