narumi tatsuya
/
mou
ニョロゾ
main.cpp@1:7382df606336, 2020-11-06 (annotated)
- Committer:
- naruu
- Date:
- Fri Nov 06 06:40:01 2020 +0000
- Revision:
- 1:7382df606336
- Parent:
- 0:04440e6b70fc
- Child:
- 2:98629c0bb9ff
KO
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
naruu | 0:04440e6b70fc | 1 | #include "mbed.h" |
naruu | 0:04440e6b70fc | 2 | |
naruu | 0:04440e6b70fc | 3 | DigitalIn flight(D6); //フライトピン |
naruu | 0:04440e6b70fc | 4 | DigitalOut SW(D7); |
naruu | 0:04440e6b70fc | 5 | DigitalOut myled(LED1); //トリガー用 |
naruu | 0:04440e6b70fc | 6 | |
naruu | 0:04440e6b70fc | 7 | |
naruu | 0:04440e6b70fc | 8 | int main() { |
naruu | 0:04440e6b70fc | 9 | |
naruu | 0:04440e6b70fc | 10 | SW=1; |
naruu | 0:04440e6b70fc | 11 | flight==1;//flight pin ついてる |
naruu | 0:04440e6b70fc | 12 | |
naruu | 0:04440e6b70fc | 13 | myled=1; |
naruu | 0:04440e6b70fc | 14 | |
naruu | 0:04440e6b70fc | 15 | while(1) { |
naruu | 0:04440e6b70fc | 16 | if(flight==1) { |
naruu | 0:04440e6b70fc | 17 | wait(10); |
naruu | 0:04440e6b70fc | 18 | } |
naruu | 0:04440e6b70fc | 19 | |
naruu | 0:04440e6b70fc | 20 | else{ |
naruu | 0:04440e6b70fc | 21 | if(flight==1) { |
naruu | 0:04440e6b70fc | 22 | wait(10); |
naruu | 0:04440e6b70fc | 23 | } |
naruu | 0:04440e6b70fc | 24 | else{ |
naruu | 0:04440e6b70fc | 25 | myled=0; |
naruu | 0:04440e6b70fc | 26 | SW = 0; |
naruu | 1:7382df606336 | 27 | printf("こんにちわ!"); //p23をlow(0V)にする。 |
naruu | 0:04440e6b70fc | 28 | break; |
naruu | 0:04440e6b70fc | 29 | } |
naruu | 0:04440e6b70fc | 30 | |
naruu | 0:04440e6b70fc | 31 | |
naruu | 0:04440e6b70fc | 32 | |
naruu | 0:04440e6b70fc | 33 | } |
naruu | 0:04440e6b70fc | 34 | } |
naruu | 0:04440e6b70fc | 35 | } |