home light automation controller

Closed

is any one familiar with Mbed Code

am writinga code that will turn my PIRsensor on and send an output to the mbed and the mbed will enable a power cord which will on my light

my challenge is that the light keep coming on and off after specified waiting time even when it is not sensing any motion

can one help me correct the code, see it below

#include "mbed.h"

DigitalOut myled(LED1);

DigitalOut ctrl(p8);

DigitalIn PIR(p20);

int main()

{

myled=0;

while(1)

{

if (PIR==1)

{

myled=1;

ctrl=1;

wait(10);

}

myled=0;

ctrl=0;

wait(10);

if (PIR==0)

{

myled=0;

ctrl=0;

}

}

}

Skills: C Programming

See more: light challenge, int power, c programming power, c# programming challenge, c programming challenge, challenge programming, c# code challenge, automation programming, sensing, PIR, cord, motion controller, home automation code, code light automation, programming control light home automation, mbed home automation, code home automation, code automation, arduino home automation light switch, arduino connect light home, programming home automation, home automation programming, p8, work home software tester part time 2009, work home software tester part time

Project ID: #4414974

9 freelancers are bidding on average $381 for this job

spcinc

Dear sir! I can provide perfect solution immediately. I'm ready.

$350 USD in 0 days
(7 Reviews)
5.7
aapS0ftware

I can do it

$800 USD in 3 days
(6 Reviews)
3.1
ZiedanStein

Hello sir, i am ready to help you as i have the solution, also i can do it cheaper than offered sir hope to work with you Best Regards

$275 USD in 0 days
(1 Review)
1.1
tousifbasheer

Am interested!!! PM me.

$550 USD in 3 days
(0 Reviews)
0.0
Phalt

Hi! I have strong experience in embedded C programming! Please, read the PM.

$275 USD in 1 day
(0 Reviews)
0.0
kasilisoft

I am sure that i can deliver the solution with quality on time !!

$250 USD in 2 days
(0 Reviews)
0.0
prabhuvd

I can meet your requirement immediately.

$251 USD in 0 days
(0 Reviews)
0.0
wasimarshad88

i am ready to start

$500 USD in 3 days
(0 Reviews)
0.0
au3

Can help you with your project.

$275 USD in 0 days
(0 Reviews)
0.8
heapau

Please check your PM!

$250 USD in 3 days
(0 Reviews)
0.0