Street light control system banate h, onboard LED ko light jaise use karke. Isme sabse important part h ldr ka min, max, ambient rakhke thresholds nikalna.

Dependencies:   HysteresisIn mbed

main.cpp

Committer:
akashlal
Date:
2016-07-01
Revision:
0:2821276434a8

File content as of revision 0:2821276434a8:

#include "mbed.h"
#include "HysteresisIn.h"

//analog pin, two thresholds and initial state 
HysteresisIn    ldr(PTB1, 0.2, 0.4, 0);
DigitalOut led(PTD1);

int main() {
    while(1) {
        led = 1-ldr.read();//led.write(ldr.read()); //boolean value
     }
}