Daisuke Sato / Mbed 2 deprecated MATSU-bed_softwareserial

Dependencies:   mbed MATSUbed USBDevice

Committer:
Tiryoh
Date:
Wed Oct 05 10:49:44 2016 +0000
Revision:
0:41789135608a
Child:
1:f3d4794ec7a4
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Tiryoh 0:41789135608a 1 #include "mbed.h"
Tiryoh 0:41789135608a 2 #include "USBSerial.h"
Tiryoh 0:41789135608a 3
Tiryoh 0:41789135608a 4 #define LED1 P0_29
Tiryoh 0:41789135608a 5 #define LED2 P0_28
Tiryoh 0:41789135608a 6 #define LED3 P0_27
Tiryoh 0:41789135608a 7 #define LED4 P0_26
Tiryoh 0:41789135608a 8
Tiryoh 0:41789135608a 9 #define ISP0 P0_4
Tiryoh 0:41789135608a 10 #define ISP1 P0_16
Tiryoh 0:41789135608a 11
Tiryoh 0:41789135608a 12 USBSerial pc;
Tiryoh 0:41789135608a 13 BusOut myled(LED1, LED2, LED3, LED4);
Tiryoh 0:41789135608a 14
Tiryoh 0:41789135608a 15 //DigitalIn sw1(ISP0);
Tiryoh 0:41789135608a 16 //DigitalIn sw2(ISP1);
Tiryoh 0:41789135608a 17
Tiryoh 0:41789135608a 18 int main() {
Tiryoh 0:41789135608a 19 myled = 0b0000;
Tiryoh 0:41789135608a 20 while(pc.readable() == 0);
Tiryoh 0:41789135608a 21 pc.printf("KEY DETECTED!!\r\nPROGRAM START\r\n");
Tiryoh 0:41789135608a 22 while(1){
Tiryoh 0:41789135608a 23 pc.printf("program running...\r\n");
Tiryoh 0:41789135608a 24 myled = 0b0001;
Tiryoh 0:41789135608a 25 wait(0.5);
Tiryoh 0:41789135608a 26 myled = 0b0000;
Tiryoh 0:41789135608a 27 wait(0.5);
Tiryoh 0:41789135608a 28 }
Tiryoh 0:41789135608a 29 }