EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / ok check this out : first

ok check this out : first

|

Projects › Projects › About LCD 2×16 › ok check this out : first

April 13, 2011 at 8:04 am #5969
gana
Participant

ok check this out : first code is fine but second code is not working and shows error like ( not enough RAM ) that is it. but first and second are same , i just added few else if command and others into first code not much so that s second code kk. now iwe have first and second codes below check and help me what is wrong..

1)

 

char keypadPort at P0;
sbit input4 at P1_4_bit;
sbit input3 at P2_7_bit;
sbit input2 at P2_6_bit;
sbit input1 at P1_3_bit;
sbit LCD_RS at P2_0_bit;
sbit LCD_EN at P2_1_bit;
sbit LCD_D4 at P2_2_bit;
sbit LCD_D5 at P2_3_bit;
sbit LCD_D6 at P2_4_bit;
sbit LCD_D7 at P2_5_bit;
// End Lcd module connections
void main() {
P1=0;
input2=0;
input3=0;
                          // Initialize Keypad
  Lcd_Init();                              // Initialize Lcd
  Lcd_Cmd(_LCD_CLEAR);                     // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);                // Cursor off
  Lcd_Out(1, 1, ” bvx yum  “);                 // Write message text on Lcd
  Lcd_Out(2, 1, ” ok bna “);
while (1){
if((input1==1)&&(input2==0) &&(input3==0)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “gal”); }
else if ((input1==0)&&(input2==1) &&(input3==0)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “xaalga “);}

  }
}   }

 

 

2)

 

char keypadPort at P0;
sbit input4 at P1_4_bit;
sbit input3 at P2_7_bit;
sbit input2 at P2_6_bit;
sbit input1 at P1_3_bit;
sbit LCD_RS at P2_0_bit;
sbit LCD_EN at P2_1_bit;
sbit LCD_D4 at P2_2_bit;
sbit LCD_D5 at P2_3_bit;
sbit LCD_D6 at P2_4_bit;
sbit LCD_D7 at P2_5_bit;
// End Lcd module connections
void main() {
P1=0;
input2=0;
input3=0;
                          // Initialize Keypad
  Lcd_Init();                              // Initialize Lcd
  Lcd_Cmd(_LCD_CLEAR);                     // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);                // Cursor off
  Lcd_Out(1, 1, ” bvx yum  “);                 // Write message text on Lcd
  Lcd_Out(2, 1, ” ok bna “);
while (1){
if((input1==1)&&(input2==0) &&(input3==0)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “gal”); }
else if ((input1==0)&&(input2==1) &&(input3==0)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “xaalga “);}
else if ((input1==0)&&(input2==0) &&(input3==1)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “tsonx “);}
else if ((input1==0)&&(input2==0) &&(input3==0)&&(input4==1))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “xodolgoon”);}
else if((input1==1)&&(input2==1)&&(input3==0)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “gal”);
  Lcd_Out(2, 1, “xaalga “);}
else if((input1==1)&&(input2==0)&&(input3==1)&&(input4==0))
  {  Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “gal”);
  Lcd_Out(2, 1, “tsonx “);
  }
else if((input1==1)&&(input2==0)&&(input3==0)&&(input4==1))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “gal”);
  Lcd_Out(2, 1, “xodolgoon “);}
else if((input1==0)&&(input2==1)&&(input3==1)&&(input4==0))
  {Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “tsonx “);
  Lcd_Out(2, 1, “xaalga “);}
else if((input1==0)&&(input2==1)&&(input3==0)&&(input4==1))
  { Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “xodolgoon “);
  Lcd_Out(2, 1, “xaalga “);}
else if((input1==0)&&(input2==0)&&(input3==1)&&(input4==1))
  { Lcd_Cmd(_LCD_CLEAR);
  Lcd_Out(1, 1, “xodolgoon “);
  Lcd_Out(2, 1, “tsonx “);
  }
}   }

 

RSS Recent Posts

  • Need Help Figuring Out the Schematics Of Circuit Board May 13, 2025
  • Wish to buy Battery, Charger and Buck converter for 12V , 2A router May 12, 2025
  • applying solder paste from a jar May 12, 2025
  • Question i-nears headphones magnetic drivers May 12, 2025
  • An Update On Tarrifs May 12, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise