Yoji KURODA
/
Mechatro_DigitalIn
Mechatronics example program
main.cpp@0:fbfdf477cfd1, 2017-10-05 (annotated)
- Committer:
- ykuroda
- Date:
- Thu Oct 05 07:44:05 2017 +0000
- Revision:
- 0:fbfdf477cfd1
- Child:
- 1:e450b69e093a
1st commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ykuroda | 0:fbfdf477cfd1 | 1 | #include "mbed.h" |
ykuroda | 0:fbfdf477cfd1 | 2 | |
ykuroda | 0:fbfdf477cfd1 | 3 | DigitalOut myled(LED1); |
ykuroda | 0:fbfdf477cfd1 | 4 | DigitalIn d0(D0); |
ykuroda | 0:fbfdf477cfd1 | 5 | |
ykuroda | 0:fbfdf477cfd1 | 6 | int main() { |
ykuroda | 0:fbfdf477cfd1 | 7 | while(1) { |
ykuroda | 0:fbfdf477cfd1 | 8 | myled = ~myled; // LED is toggled |
ykuroda | 0:fbfdf477cfd1 | 9 | |
ykuroda | 0:fbfdf477cfd1 | 10 | printf("D[%1d]\n",d0); |
ykuroda | 0:fbfdf477cfd1 | 11 | } |
ykuroda | 0:fbfdf477cfd1 | 12 | } |