風速計のパルスを間引く用のテストコード

Dependencies:   mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "rtos.h"
00003 
00004 DigitalOut led1(LED1);
00005 DigitalOut led2(LED2);
00006 
00007 void DigitalRepeat()
00008 {
00009     while(1) {
00010         led2 = 1;
00011         wait_ms(20);
00012         led2 = 0;
00013         wait_ms(20);
00014     }
00015 }
00016 
00017 int main()
00018 {
00019     Thread DigitalThread(&DigitalRepeat);
00020     while(1) {
00021         led1 = 1;
00022         wait(0.2);
00023         led1 = 0;
00024         wait(0.2);
00025     }
00026 }