mbed workshop intro + cansat examples

MySw2.cpp

Committer:
yamaguch
Date:
2012-05-10
Revision:
0:f309f06aeec7

File content as of revision 0:f309f06aeec7:

#include "mbed.h"

DigitalOut myled(p5);
DigitalIn mysw(p8);

int main() {
    bool stateSW = false;
    
    while (true) {
        if (mysw != stateSW) {
            stateSW = !stateSW;
            if (stateSW) {
                myled = !myled;
            }
        }
    }
}