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 / Thanx…..When i added 0b

Thanx…..When i added 0b

|

Microcontroller › AVR › water level controller › Thanx…..When i added 0b

August 15, 2011 at 7:30 am #6608
Maneesh PK
Participant

Thanx…..

When i added 0b with the binary value it worked….

 

I defined adcout as int.

I have variation of 0x00 to 0x32 (0d50).

So i just multiplied adcout by 2 (0b10)

Converted into decimal charactor by itoa()

and desplayed.

Now it is working…

 

 

 

I also have a 4×4 keypad.

And i need to change the limits using it

 

The keys are like

 

Menu         1        2           3

Back          4        5           6

Exit            7        8           9

Delete     Left       0       Right

 

 

 

So while working if i type 50 for lower limit and 95 for higher limit and set it, after that the motor should turn on when level goes below 50%. and off above 95%.

 

 

 

 

I was doing like this.

When higher limit option is selected it will call  the function higher_limit()

 

 

 

 

 

void higher_limit(void)
{
 
init_LCD();
LCD_write_string(“ENTER LIMIT”);
LCD_cmd(0xC0);
key=0;
 
int i;
i=0;
 
 
 
while(1)
 
{
 
PORTD=0xF0;
value=PIND;
key=0;
_delay_ms(100);
 
if (value!=0xf0)
 
{
check1();
check2();
check3();
check4();
 
if (key==’M’)
{
init_LCD();
LCD_write_string(“LIMIT IS SET”);
LCD_cmd(0x0c);
LCD_write_string(h_l);
LCD_cmd(0xc0);
_delay_ms(500);
main();
 
}
 
else if (key==’B’)
{
edit_limits();
}
else if (key==’E’)
{
main();
}
 
else if (key==’1′)
{
LCD_write_string(“1”);
_delay_us(1);
h_l=1;
 
}
else if (key==’2′)
{
LCD_write_string(“2”);
_delay_us(1);
h_l=2;
 
}
 
else if (key==’3′)
{
LCD_write_string(“3”);
_delay_us(1);
h_l=3;
 
}
else if (key==’4′)
{
LCD_write_string(“4”);
_delay_us(1);
h_l=4;
 
}
else if (key==’5′)
{
LCD_write_string(“5”);
_delay_us(1);
h_l=5;
 
}
else if (key==’6′)
{
LCD_write_string(“6”);
_delay_us(1);
h_l=6;
 
}
else if (key==’7′)
{
LCD_write_string(“7”);
_delay_us(1);
h_l=7;
 
}
else if (key==’8′)
{
LCD_write_string(“8”);
_delay_us(1);
h_l=8;
 
}
else if (key==’9′)
{
LCD_write_string(“9”);
_delay_us(1);
h_l=9;
 
}
 
else if (key==’Z’)
{
LCD_write_string(“0”);
_delay_us(1);
h_l=0;
 
}
 
else if (key==’D’)
{
LCD_cmd(0x10);
LCD_write_string(” “);
_delay_us(1);
LCD_cmd(0x10);
i=i-1;
}
 
i=i+1;
 
 
 
}
 
}
 
}
 
 
 
 
 
 
 
 
I was planning to convert h_l into some integer value and compare…
 
But it is not working…
 
 
Also for delete what i have done is that
move cursor left;
print one space;
move cursor left;
 
is there any other way for it?…
 
 
I defined variable h_l as char.

char h_l [50];

 

 

 

how can i make it  ?  ……

RSS Recent Posts

  • Harman Kardon radio module BMW noise February 16, 2026
  • Arduino standalone minimal February 16, 2026
  • analog logic of shmidt trigger bjt circuit February 16, 2026
  • CR2/CR123A Batteries In Projects February 16, 2026
  • Math problem February 15, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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