Lee Nam Cheol / Mbed OS lab06-mutex-yes
Committer:
namcheol
Date:
Mon Apr 27 08:02:20 2020 +0000
Revision:
2:20e20cfae75e
Parent:
1:89d23c8072af
Child:
3:1c8ab6d6af18
lab04-uart-tx

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dshin 0:f31836d48420 1 #include "mbed.h"
dshin 0:f31836d48420 2
namcheol 2:20e20cfae75e 3 Serial uart_tx(D1, D0); //D1 = tx, D0 = rx
namcheol 2:20e20cfae75e 4 DigitalIn sw(D2, PullDown);
dshin 0:f31836d48420 5
dshin 0:f31836d48420 6 int main()
dshin 0:f31836d48420 7 {
namcheol 2:20e20cfae75e 8 while(true) {
namcheol 2:20e20cfae75e 9 if(sw == 1) {
namcheol 2:20e20cfae75e 10 uart_tx.putc('1');
namcheol 2:20e20cfae75e 11 thread_sleep_for(200);
namcheol 1:89d23c8072af 12 }
dshin 0:f31836d48420 13 }
dshin 0:f31836d48420 14 }