GROVE - 傾きセンサ サンプルプログラム

Dependencies:   mbed

main.cpp

Committer:
jksoft
Date:
2013-11-29
Revision:
0:5c86cd8bc659

File content as of revision 0:5c86cd8bc659:

#include "mbed.h"

DigitalOut myled(LED1);
DigitalIn TiltSensor(p5);

int main() {
    while(1) {
        if(TiltSensor==1){
            myled = 1;
        } else {
            myled = 0;
        }
        wait(0.2);
    }
}