![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mbed電子工作レシピ リスト4.1のプログラム
main.cpp@0:ff2497eea45b, 2015-12-23 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Dec 23 15:33:14 2015 +0000
- Revision:
- 0:ff2497eea45b
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_Cookbook_SE | 0:ff2497eea45b | 1 | #include "mbed.h" |
mbed_Cookbook_SE | 0:ff2497eea45b | 2 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 3 | Ticker flipper; |
mbed_Cookbook_SE | 0:ff2497eea45b | 4 | DigitalOut myled(LED1); |
mbed_Cookbook_SE | 0:ff2497eea45b | 5 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 6 | void flip() { |
mbed_Cookbook_SE | 0:ff2497eea45b | 7 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 8 | myled = !myled; |
mbed_Cookbook_SE | 0:ff2497eea45b | 9 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 10 | } |
mbed_Cookbook_SE | 0:ff2497eea45b | 11 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 12 | int main() { |
mbed_Cookbook_SE | 0:ff2497eea45b | 13 | flipper.attach(&flip, 0.2); |
mbed_Cookbook_SE | 0:ff2497eea45b | 14 | |
mbed_Cookbook_SE | 0:ff2497eea45b | 15 | while(1) { |
mbed_Cookbook_SE | 0:ff2497eea45b | 16 | } |
mbed_Cookbook_SE | 0:ff2497eea45b | 17 | } |