
00
Dependencies: EthernetInterface mbed-rtos mbed
Revision 0:fcc903b661d5, committed 2015-05-28
- Comitter:
- jys1
- Date:
- Thu May 28 13:14:48 2015 +0000
- Commit message:
- 00;
Changed in this revision
diff -r 000000000000 -r fcc903b661d5 EthernetInterface.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EthernetInterface.lib Thu May 28 13:14:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
diff -r 000000000000 -r fcc903b661d5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 28 13:14:48 2015 +0000 @@ -0,0 +1,45 @@ +#include "mbed.h" +#include "EthernetInterface.h" + +DigitalOut led_red(LED_RED); +DigitalOut led_green(LED_GREEN); +DigitalIn sw2(SW2); +DigitalIn sw3(SW3); +Serial pc(USBTX, USBRX); + +void check_sw2(void) +{ + if (sw2 == 0) { + pc.printf("SW2 button pressed. \n"); + led_red = 0; + led_green = 1; + } +} + +void check_sw3(void) +{ + if (sw3 == 0) { + pc.printf("SW3 button pressed. \n"); + led_green = 0; + led_red = 1; + pc.printf("5 characters will be echoed. Start typing. \n"); + for (uint32_t i = 0; i < 5; i++) { + pc.putc(pc.getc()); + } + pc.putc(13); /* CR */ + pc.putc(10); /* LF */ + } +} + +int main() { + led_green = 1; + led_red = 1; + pc.baud(115200); + pc.printf("Hello World from FRDM-K64F board.\n"); + + while (true) { + check_sw2(); + check_sw3(); + wait(0.3); + } +}
diff -r 000000000000 -r fcc903b661d5 mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Thu May 28 13:14:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#2db19f47c2ba
diff -r 000000000000 -r fcc903b661d5 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 28 13:14:48 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92 \ No newline at end of file