SlideShare a Scribd company logo
#include<reg51.h>
sbit s1=(P0^1);
sbit s2=(P0^2);
sbit s3=(P0^3);
sbit s4=(P0^4);
sbit d1=(P1^1);
sbit d2=(P1^2);
sbit d3=(P1^3);
sbit d4=(P1^4);
sbit en=(P1^5);
#define cmdport P3
#define dataport P2
#define q 10
#define O 1
sbit rs=cmdport^2;//register select pin
sbit rw=cmdport^1;//read write pin
sbit e=cmdport^0;//enable pin
void delay(unsigned int msec)//Function to provide time delay in msec.
{
int i,j;
for(i=0;i<msec;i++)
for(j=0;j<550;j++);
}
void lcdcmd(unsigned char msg)//Function to send command to LCD
{
dataport=msg;
rs=0;
rw=0;
e=1;
delay(1);
e=0;
}
void lcddata(unsigned char item)//Function to send data to LCD
{
dataport=item;
rs=1;
rw=0;
e=1;
delay(1);
e=0;
}
lcddat(unsigned char*item)//function to send string to LCD
{
int x;
for(x=0;item[x]!=0;x++)
{
lcddata(item[x]);
}
}
void main()
{
P1=0x00;
P2=0x00;
P3=0x00;
delay(100);
lcdcmd(0x38);
delay(q);
lcdcmd(0x01);
delay(q);
lcdcmd(0x0C);
delay(q);
lcdcmd(0x80);
delay(q);
lcddat("Wireless Gesture");
lcdcmd(0xC0);
delay(q);
lcddat("Controlled Robot");
delay(700);
lcdcmd(0x01);
delay(q);
lcdcmd(0x81);
delay(q);
lcddat("Using AT89S52");
delay(q);
lcdcmd(0xC0);
delay(q);
lcddat("Micro-controller");
delay(700);
lcdcmd(0x38);
delay(q);
lcdcmd(0x01);
delay(q);
lcdcmd(0x0C);
delay(q);
lcdcmd(0x86);
delay(q);
lcddat("By:");
delay(q);
lcdcmd(0xC2);
delay(q);
lcddat("Group No.8");
delay(650);
while(1)
{
if(!s1 & !s2 & s3 & !s4)
{
en=1;
d1=1,d3=1;
d2=0,d4=0;
lcdcmd(0x38);
delay(q);
en=0;
lcdcmd(0x01);
delay(q);
en=1;
lcdcmd(0x0C);
delay(q);
lcdcmd(0x80);
en=0;
delay(q);
lcddat("Receiving Signal.");
en=1;
delay(q);
lcdcmd(0xC0);
delay(q);
en=0;
lcdcmd(0x0C);
delay(q);
en=1;
lcddat("GOING FORWARD");
delay(40);
en=0;
}
if(!s1 & !s2 & !s3 & s4)
{
en=1;
d1=0,d4=0;
d2=1,d3=1;
lcdcmd(0x38);
delay(q);
en=0;
lcdcmd(0x01);
delay(q);
en=1;
lcdcmd(0x0C);
delay(q);
lcdcmd(0x80);
delay(q);
en=0;
lcddat("Receiving Signal.");
delay(q);
en=1;
lcdcmd(0xC0);
delay(q);
en=0;
lcdcmd(0x0C);
delay(q);
en=1;
lcddat("GOING REVERSE");
delay(40);
en=0;
}
if(!s1 & s2 & !s3 & !s4)
{
en=1;
d1=0,d3=0;
d2=1,d4=1;
lcdcmd(0X38);
delay(q);
en=0;
lcdcmd(0x01);
en=1;
delay(5);
en=0;
lcdcmd(0x0C);
en=1;
delay(5);
en=0;
lcdcmd(0x80);
en=1;
delay(q);
en=1;
delay(5);
en=0;
lcddat("Receiving Signal.");
delay(q);
lcdcmd(0xC0);
delay(q);
lcdcmd(0x0C);
delay(q);
lcddat("TURNING RIGHT");
en=1;
delay(5);
en=0;
delay(2);
en=1;
delay(5);
en=0;
en=1;
delay(5);
en=0;
delay(40);
}
if(s1 & !s2 & !s3 & !s4)
{
en=1;
d1=1,d4=1;
d2=0,d3=0;
lcdcmd(0x38);
delay(q);
en=0;
lcdcmd(0x01);
en=1;
delay(5);
en=0;
lcdcmd(0x0C);
en=1;
delay(5);
en=0;
lcdcmd(0x80);
en=1;
delay(q);
en=1;
delay(5);
en=0;
lcddat("Receiving Signal.");
delay(q);
lcdcmd(0xC0);
delay(q);
lcdcmd(0x0c);
delay(q);
lcddat("TURNING LEFT");
en=1;
delay(5);
en=0;
delay(2);
en=1;
delay(5);
en=0;
en=1;
delay(5);
en=0;
delay(40);
}
if(!s1 & !s2 & !s3 & !s4)
{
en=0;
d1=0;
d2=0;
d3=0;
d4=0;
lcdcmd(0x38);
delay(q);
lcdcmd(0x01);
delay(q);
lcdcmd(0x0C);
delay(q);
lcdcmd(0x80);
delay(q);
lcddat("No Signal");
delay(q);
lcdcmd(0xC0);
delay(q);
lcdcmd(0x0C);
delay(q);
lcddat("STOP");
delay(40);
}
delay(40);
}

More Related Content

What's hot

3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl
Sampath Kumar S
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual Machines
Eleanor McHugh
 
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Igalia
 
Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)
Igalia
 
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
Igalia
 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
Linaro
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
Pda to cfg h2
Pda to cfg h2Pda to cfg h2
Pda to cfg h2
Rajendran
 
Unit 4 assembly language programming
Unit 4   assembly language programmingUnit 4   assembly language programming
Unit 4 assembly language programming
Kartik Sharma
 
Code GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limitersCode GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limiters
Marina Kolpakova
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
04 sequentialbasics 1
04 sequentialbasics 104 sequentialbasics 1
04 sequentialbasics 1
Poornima Prasad
 
Compiler presention
Compiler presentionCompiler presention
Compiler presention
Faria Priya
 
Shift rotate
Shift rotateShift rotate
Shift rotate
fika sweety
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Marina Kolpakova
 
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
Zhen Wei
 
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etcComparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Yukio Okuda
 
Microprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch InstructionMicroprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch Instruction
Arkhom Jodtang
 

What's hot (20)

3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl
 
GoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual MachinesGoLightly: A Go Library For Building Virtual Machines
GoLightly: A Go Library For Building Virtual Machines
 
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
Guile 3: Faster programs via just-in-time compilation (FOSDEM 2019)
 
Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)
 
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
Knit, Chisel, Hack: Building Programs in Guile Scheme (Strange Loop 2016)
 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
ocelot
ocelotocelot
ocelot
 
Pda to cfg h2
Pda to cfg h2Pda to cfg h2
Pda to cfg h2
 
Unit 4 assembly language programming
Unit 4   assembly language programmingUnit 4   assembly language programming
Unit 4 assembly language programming
 
Code GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limitersCode GPU with CUDA - Identifying performance limiters
Code GPU with CUDA - Identifying performance limiters
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
04 sequentialbasics 1
04 sequentialbasics 104 sequentialbasics 1
04 sequentialbasics 1
 
Compiler presention
Compiler presentionCompiler presention
Compiler presention
 
Shift rotate
Shift rotateShift rotate
Shift rotate
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
 
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
[Sitcon2018] Analysis and Improvement of IOTA PoW Implementation
 
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etcComparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
 
Microprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch InstructionMicroprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch Instruction
 

Viewers also liked

reasons forContinuous hike in rtc fares
 reasons forContinuous hike in rtc fares reasons forContinuous hike in rtc fares
reasons forContinuous hike in rtc faresJagadesh Chandu
 
Blanchardstown and castleknock area
Blanchardstown and castleknock areaBlanchardstown and castleknock area
Blanchardstown and castleknock areaashkelly
 
Folleto de Rebajas de enero y febrero 2014 muebles La Factoría
Folleto de Rebajas de enero y febrero 2014 muebles La FactoríaFolleto de Rebajas de enero y febrero 2014 muebles La Factoría
Folleto de Rebajas de enero y febrero 2014 muebles La Factoría
Muebles La Factoría
 
Castles in Dublin 15
Castles in Dublin 15Castles in Dublin 15
Castles in Dublin 15ashkelly
 
Blanchardstown
BlanchardstownBlanchardstown
Blanchardstown
ashkelly
 
Medieval castles
Medieval castlesMedieval castles
Medieval castlesashkelly
 
Medievalcastles
MedievalcastlesMedievalcastles
Medievalcastlesashkelly
 

Viewers also liked (9)

reasons forContinuous hike in rtc fares
 reasons forContinuous hike in rtc fares reasons forContinuous hike in rtc fares
reasons forContinuous hike in rtc fares
 
Blanchardstown and castleknock area
Blanchardstown and castleknock areaBlanchardstown and castleknock area
Blanchardstown and castleknock area
 
Y
YY
Y
 
Informatica 2 trabajo de las web
Informatica 2 trabajo de las webInformatica 2 trabajo de las web
Informatica 2 trabajo de las web
 
Folleto de Rebajas de enero y febrero 2014 muebles La Factoría
Folleto de Rebajas de enero y febrero 2014 muebles La FactoríaFolleto de Rebajas de enero y febrero 2014 muebles La Factoría
Folleto de Rebajas de enero y febrero 2014 muebles La Factoría
 
Castles in Dublin 15
Castles in Dublin 15Castles in Dublin 15
Castles in Dublin 15
 
Blanchardstown
BlanchardstownBlanchardstown
Blanchardstown
 
Medieval castles
Medieval castlesMedieval castles
Medieval castles
 
Medievalcastles
MedievalcastlesMedievalcastles
Medievalcastles
 

Similar to New text document

Keypad program
Keypad programKeypad program
Keypad program
ksaianil1
 
Temperature Control Fan Using 8051 Microcontroller
Temperature Control Fan Using 8051 MicrocontrollerTemperature Control Fan Using 8051 Microcontroller
Temperature Control Fan Using 8051 Microcontroller
Mafaz Ahmed
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
Programming Homework Help
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
SANTIAGO PABLO ALBERTO
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
Syed Ghufran Hassan
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
AAKASH KUMAR
 
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
ABHISHEK MAURYA
 
2.1 ### uVision Project, (C) Keil Software .docx
2.1   ### uVision Project, (C) Keil Software    .docx2.1   ### uVision Project, (C) Keil Software    .docx
2.1 ### uVision Project, (C) Keil Software .docx
tarifarmarie
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
hairilfaiz86
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1
kkkseld
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
jokersclown57
 
Robotics lec7
Robotics lec7Robotics lec7
Robotics lec7
Mahmoud Hussein
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
babak danyal
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
Kandarp Tiwari
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
julioalexanderaguila
 
Tai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinhTai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinh
Hồ Trường
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
Akhil Unnikrishnan
 
8051 -5
8051 -58051 -5

Similar to New text document (20)

Keypad program
Keypad programKeypad program
Keypad program
 
REPORT
REPORTREPORT
REPORT
 
Temperature Control Fan Using 8051 Microcontroller
Temperature Control Fan Using 8051 MicrocontrollerTemperature Control Fan Using 8051 Microcontroller
Temperature Control Fan Using 8051 Microcontroller
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
 
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
 
2.1 ### uVision Project, (C) Keil Software .docx
2.1   ### uVision Project, (C) Keil Software    .docx2.1   ### uVision Project, (C) Keil Software    .docx
2.1 ### uVision Project, (C) Keil Software .docx
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Robotics lec7
Robotics lec7Robotics lec7
Robotics lec7
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
Tai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinhTai lieu ky thuat lap trinh
Tai lieu ky thuat lap trinh
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
 
8051 -5
8051 -58051 -5
8051 -5
 

New text document