The document describes code for an Arduino project that uses a PIR sensor and sonar sensors to detect humans. It includes code for an auto mode and manual mode, with the auto mode using sensors to control motors and the manual mode allowing control via radio signals. Functions are defined for the sensors, motors and radio communication.
1. CODING IN ARDUINO:
The open-source Arduino Programming (IDE) makes it simple to compose code and transfer it
to the board. It keeps running on Windows, Macintosh OS X, and Linux. Nature is composed in
Java and in light of Handling and other open-source programming.
For auto mode:
void AutoMode()
{
if(ResetCheck == 0)
{
if(PIRValue == 1)
{
radio.stopListening();
unsigned long time = 1;
radio.write( &time, sizeof(unsigned long) );
radio.startListening();
MotorsStop();
while(1)
{
PIRSensor();
if ( radio.available() )
{
unsigned long data = 0;
radio.read( &data, sizeof(unsigned long) );
Serial.println(data);