デジタル出力のサンプルプログラム
Dependencies: mbed
main.cpp@0:4d047a1ff8ec, 2019-07-29 (annotated)
- Committer:
- GGU
- Date:
- Mon Jul 29 02:53:57 2019 +0000
- Revision:
- 0:4d047a1ff8ec
- Child:
- 1:6991274d01d0
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GGU | 0:4d047a1ff8ec | 1 | #include "mbed.h" |
GGU | 0:4d047a1ff8ec | 2 | |
GGU | 0:4d047a1ff8ec | 3 | DigitalOut myled(LED1); |
GGU | 0:4d047a1ff8ec | 4 | |
GGU | 0:4d047a1ff8ec | 5 | int main() { |
GGU | 0:4d047a1ff8ec | 6 | while(1) { |
GGU | 0:4d047a1ff8ec | 7 | myled = 1; // LED is ON |
GGU | 0:4d047a1ff8ec | 8 | wait(0.2); // 200 ms |
GGU | 0:4d047a1ff8ec | 9 | myled = 0; // LED is OFF |
GGU | 0:4d047a1ff8ec | 10 | wait(1.0); // 1 sec |
GGU | 0:4d047a1ff8ec | 11 | } |
GGU | 0:4d047a1ff8ec | 12 | } |