deLIGHT ME
- this is what i named for this smart thing. When the sensor detects that the light changes to dim, it automatically turn on the lamp. As of now this is just a beginner sample for IOT project, soonest i will develop this 'delight me' with another functionality.
I will give you the code for this one, I am using JS.
//CPF- deLIGHT Me
var value = cpf.get("light sensor");
if (value < 10) {
//Control Digital-out D2
var d2 = ui.get("socket d2");
cpf.set("socket d2", 1)
cpf.repeat();
}
else {
//Control Digital-out D2
var d2 = ui.get("socket d2");
cpf.set("socket d2", 0);
cpf.repeat();
}
The cable of the lamp is connected to the relay then from relay to arduino shield next is the light sensor connected again to arduino shield.
Thank you guys, i will be posting here for more updates.