예제1) LED 토글 예제
Dependencies: mbed
Fork of ex1_mbed_first by
main.cpp@1:edee77006ef2, 2017-10-13 (annotated)
- Committer:
- robertchoi
- Date:
- Fri Oct 13 01:43:34 2017 +0000
- Revision:
- 1:edee77006ef2
- Parent:
- 0:e075e2cea604
LED1 -> LED2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
robertchoi | 0:e075e2cea604 | 1 | // Toggle a LED |
robertchoi | 0:e075e2cea604 | 2 | #include "mbed.h" |
robertchoi | 0:e075e2cea604 | 3 | |
robertchoi | 1:edee77006ef2 | 4 | DigitalOut led(LED2); |
robertchoi | 0:e075e2cea604 | 5 | |
robertchoi | 0:e075e2cea604 | 6 | int main() { |
robertchoi | 0:e075e2cea604 | 7 | while(1) { |
robertchoi | 0:e075e2cea604 | 8 | led = !led; |
robertchoi | 0:e075e2cea604 | 9 | wait(0.2); |
robertchoi | 0:e075e2cea604 | 10 | } |
robertchoi | 0:e075e2cea604 | 11 | } |