Katsuya Matsuura
/
MbedIOTest1015
MbedIOTest(Kindleの本を参考にしている)
main.cpp@0:6143877436c1, 2018-10-15 (annotated)
- Committer:
- kasistorange
- Date:
- Mon Oct 15 10:59:43 2018 +0000
- Revision:
- 0:6143877436c1
Test for sist;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kasistorange | 0:6143877436c1 | 1 | #include "mbed.h" |
kasistorange | 0:6143877436c1 | 2 | |
kasistorange | 0:6143877436c1 | 3 | DigitalOut led1(LED1); |
kasistorange | 0:6143877436c1 | 4 | |
kasistorange | 0:6143877436c1 | 5 | void led1_thread(void const *argument) |
kasistorange | 0:6143877436c1 | 6 | { |
kasistorange | 0:6143877436c1 | 7 | while(true){ |
kasistorange | 0:6143877436c1 | 8 | led1=!led1; |
kasistorange | 0:6143877436c1 | 9 | Thread::wait(1000); |
kasistorange | 0:6143877436c1 | 10 | } |
kasistorange | 0:6143877436c1 | 11 | } |
kasistorange | 0:6143877436c1 | 12 | |
kasistorange | 0:6143877436c1 | 13 | int main(){ |
kasistorange | 0:6143877436c1 | 14 | Thread thread(led1_thread); |
kasistorange | 0:6143877436c1 | 15 | while(true){ |
kasistorange | 0:6143877436c1 | 16 | printf("main thread \r\n"); |
kasistorange | 0:6143877436c1 | 17 | Thread::wait(2000); |
kasistorange | 0:6143877436c1 | 18 | } |
kasistorange | 0:6143877436c1 | 19 | } |
kasistorange | 0:6143877436c1 | 20 |