EN / USD
32
of 76
TEP , The Engineering Projects , Image

syedzainnasir

TEP , The Engineering Projects , Rating 7.5 7.5 / 10
TEP , The Engineering Projects , Icon Level: Moderator
TEP , The Engineering Projects , Icon Joined: 20 Mar 2022
TEP , The Engineering Projects , Icon Last Active: 2:21 PM
TEP , The Engineering Projects , Icon Location: TEP , The Engineering Projects , Flag
TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon
problem in code .........of led interfacing
TEP , The Engineering Projects , Calender Question: 07-Mar-2017
TEP , The Engineering Projects , Category In: 8051 Microcontroller Projects
[code]#include<reg51.h> void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); sbit sensor1=P1^0; sbit sensor2=P1^1; sbit sensor3=P1^2; sbit sensor4=P1^3; sbit sensor5=P1^4; sfr lcd_data_pin=0xA0; // data port P2 sbit rs=P3^0; // Register select pin sbit rw=P3^1; // Read write pin sbit en=P3^6; // Enable pin void delay(unsigned int msec) //delay function { int i,j; for(i=0;i<msec;i++) for(j=0;j<1275;j++); } void lcd_command(unsigned char comm) // function to send command to LCD { lcd_data_pin=comm; en=1; rs=0; rw=0; delay(1); en=0; } void lcd_data(unsigned char disp) // function to send data on LCD { lcd_data_pin=disp; en=1; rs=1; rw=0; delay(1); en=0; } lcd_dataa(unsigned char *disp) // function to send string to LCD { int x; for(x=0;disp[x]!=0;x++) { lcd_data(disp[x]); } } void lcd_ini() //Function to inisialize the LCD { lcd_command(0x38); delay(5); lcd_command(0x0F); delay(5); lcd_command(0x80); delay(5); } void main() { P3=0x00; while(1) { if(sensor5==0x01) { void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); lcd_ini(); lcd_dataa("ECE Rocks"); } else if(sensor1==0x01) { void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); lcd_ini(); lcd_dataa("move b"); } else if(sensor2==0x01) { void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); lcd_ini(); lcd_dataa("move f"); } else if(sensor3==0x01) { void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); lcd_ini(); lcd_dataa(" move l"); } else if(sensor4==0x01) { void lcd_command(unsigned char comm); void lcd_data(unsigned char disp); lcd_dataa(unsigned char *disp); lcd_ini(); lcd_dataa("move r"); } } } [/code]
TEP , The Engineering Projects , Icon Answer: 0 TEP , The Engineering Projects , Icon Views: 150 TEP , The Engineering Projects , Icon Followers: 85
Small Bio
TEP , The Engineering Projects , Tags
PLC
Robot
STM32
Arduino
AI
ESP32
Ladder Logic
PLC Projects
Programming
Communicates STM32
PLC Projects
Communicates PLC
Font Style
Alignment
Indenting and Lists
Insert Media
Insert Items

Want to leave an answer!

Word Count :0 Draft Saved at 12:42 am.