Ryo Takahashi / Mbed 2 deprecated time_division_switching

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003 DigitalOut sw1(D12);
00004 DigitalOut sw2(D11);
00005 DigitalOut sw3(D10);
00006 DigitalOut sw4(D9);
00007 
00008 //Timer timer;
00009 
00010 static const float SW_1_TO_2 = 0.7f; // [s]
00011 //static const float SW_2_TO_3 = 1.0f;
00012 //static const float SW_3_TO_4 = 1.5f;
00013 
00014 int main() {
00015     sw1 = 1; sw2 = 0;
00016     wait(SW_1_TO_2);
00017     sw1 = 0; sw2 = 1;
00018     while(1);
00019     return 0;
00020 }