Hello all
It may be stupid idea but I am trying to learn programming by writing my own programs to achieve the requirement.
Program requirement - When the person is detected in the front door, ring the bell and open the door.
In my opinion above code fulfill the requirement but I would like to know your opinions for reliable code
It may be stupid idea but I am trying to learn programming by writing my own programs to achieve the requirement.
Program requirement - When the person is detected in the front door, ring the bell and open the door.
Code:
#include<stdio.h>
#define High 1
#define Low 0
#define Open 0
#define Close 1
#define ringing 0
#define not_ringing 1
int main (void)
{
int doorbell_sensor;
int bell;
int camera;
int House_Door;
if (doorbell_sensor == High )
{
House_Door = Open ;
bell = ringing;
}
else
{
House_Door = Close;
bell = not_ringing ;
}
return 0;
}