Closed

home light automation controller

This project received 11 bids from talented freelancers with an average bid price of $366 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$250 - $750 USD
Total Bids
11
Project Description

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;
}

}


}

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online