Skip to main content

robot control


voice using 8051 coding

#include <REGX51.H>
#include<intrins.h>
#include "serial.c"
#include "lcd.c"

sbit Device1 = P0^0;
sbit Device2 = P0^1;
sbit Device3 = P0^2;
sbit Device4 = P0^3;

//sbit pir=P1^0;
sbit wmotor= P0^4;

//sbit buzer= P1^2;
/*

void pirhum()
{
if(pir==0)
{
cmdwrt_lcd(0xc0);
display_lcd("human detected");
buzer=1;
}
else
{
cmdwrt_lcd(0xc0);
display_lcd("No human detected");
buzer=0;
}
}
*/
void main()
{
unsigned char a;
Device1 = 0;
Device2 = 0;
  Device3 = 0;
Device4 = 0;
wmotor=0;
serial_init();
lcd_init();
//serial_transmit("Android and BlueTooth Based Device Control\r\n ");
cmdwrt_lcd(0x80);
display_lcd("Android&Bluetooth");
cmdwrt_lcd(0xc0);
display_lcd("Based Robo ctrl ");
delay(65000);delay(65000);
cmdwrt_lcd(0x01);
cmdwrt_lcd(0x80);
while(1)
{
//cmdwrt_lcd(0x80);
//display_lcd("WAITING FOR COMD ");
//cmdwrt_lcd(0xc0);
//display_lcd("Device2: ");
while(RI == 0);
RI = 0;
a = SBUF;
if(a == 'f')
{
// pirhum();
cmdwrt_lcd(0x80);
display_lcd("     FORWAD    ");Device1 = 0;Device2 = 1;Device3 = 1;Device4 = 0;
}
else if(a == 'b')
{
cmdwrt_lcd(0x80);
display_lcd("     BACWARD    ");Device1 = 1;Device2 = 0;Device3 = 0;Device4 = 1;
// pirhum();

}
else if(a == 'l')
{
// pirhum();
cmdwrt_lcd(0x80);
// display_lcd("     LEFT     ");Device1 = 1;Device2 = 0;Device3 = 1;Device4 = 0;

}
else if(a == 'r')
{
//pirhum();
cmdwrt_lcd(0x80);
//display_lcd("     RIGHT    ");Device1 = 0;Device2 = 1;Device3 = 0;Device4 = 1;

}
else if(a == 's')
{
//pirhum();
cmdwrt_lcd(0x80);
// display_lcd("     STOP  ");

Device1 = 0;Device2 = 0;Device3 = 0;Device4 = 0;

}
else if(a == 'g')
{
//pirhum();
cmdwrt_lcd(0xc0);
//display_lcd(" VACCUM ON");

wmotor=1;

}

else if(a == 'n')
{
//pirhum();
cmdwrt_lcd(0xc0);
// display_lcd(" VACCUM OFF ");

wmotor=0;

}
else
{
//pirhum();
cmdwrt_lcd(0x80);
//display_lcd("WRONG CMD RECIVE ");


}

  }
}

Comments

Popular posts from this blog

PUNCHING MACHINE

ACCIDENT AVOIDING SYSTEM FOR PUNCHING MACHINE SYNOPSIS The aim of our project is to take a system-wide approach to preventing the machine accident. The system includes not just the machine and the operator; but rather, it includes everything from the initial design of the machine to the training of everyone that is responsible for any aspect of it, to the documentation of all changes, to regular safety audits and a finally a corporate culture of safety-first. Design is the part of a machine's life where the greatest impact can be made in relation to avoiding accidents. The designer should ensure that the machine is safe to set up and operate, safe to install, safe to maintain, safe to repair, and safe to decommission. Although safe operation is usually at the forefront of a designer's mind, safe maintenance and repair should also be a high priority. Around 50% of fatal accidents involving industrial equipment are associated with maintenance activities, and design...

garbage monitoring using arduino code with gsm

#include <SoftwareSerial.h> #include <LiquidCrystal.h> //LiquidCrystal lcd(7, 6, 5, 4, 3, 2); LiquidCrystal lcd(13, 12, 11, 10, 9, 8); SoftwareSerial mySerial(0,1); #define trigPin 2 #define echoPin 3 #define PIR_sensor 4 #define m11 5 #define m12 6 void setup() {    lcd.begin(16, 2);    lcd.print("    Garbage    ");    Serial.println("garbage ");   lcd.setCursor(0,1);   lcd.print("   Open Close    ");   Serial.println(" open close");   delay(3000);   lcd.clear();   //lcd.print(" ");   delay(2000); mySerial.begin(9600); // Setting the baud rate of GSM Module Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT);  pinMode(m11, OUTPUT);   pinMode(m12, OUTPUT);   } void loop() {  readPIR();  pingDist();  SendMessage(); } void pingDist ()   {     long duration, distance;...