digital input example of CORE-1000

Dependencies:   mbed

main.cpp

Committer:
odb
Date:
2017-02-03
Revision:
1:4a3198da4fe1
Parent:
0:802145a6ea33

File content as of revision 1:4a3198da4fe1:

#include "mbed.h"

DigitalOut myled(PC_9);
DigitalIn Sensor_DIN(PA_6);

int main() {
    printf("\n Sensor Digital InPut example\n");
    while(1) {
        if (Sensor_DIN == 0){
            myled = 1;
            printf("sensor detected \n\r");
        }
        else{
            myled = 0;
        }
    }
}