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 / hey nidhin.k can you explain

hey nidhin.k can you explain

|

Microcontroller › 8051 › Interfacing AT89S51 with ultrasonic sensor and LCD › hey nidhin.k can you explain

February 3, 2013 at 6:00 pm #9090
zulnorain
Participant

hey nidhin.k can you explain this section of the code:

 

void Distance_Measure()
{
count=count1=0;
TH0=0x00;TL0=0x00; 
TR0=0;
for(i=0;i<10;i++)         
{
TX=0;           
Delay(1000);
TX=1;           
Delay(10);
TX=0;   
while(RX==0);
TR0=1; 
while(RX==1);
TR0=0;
count=TH0<<8;      
count=count|TL0;    
TH0=TL0=0x00; 
count1=count1+count;
Delay(5000);        
}
count=count1/10;
inch1=count%10000/1000;
inch2=count%1000/100;
result=(inch1*10)+inch2;
 
obj_distance=result-2;  
Lcd8_Decimal3(0XCb,obj_distance); 
 
}

RSS Recent Posts

  • Wien bridge oscillator January 19, 2026
  • Silicon insulated wire January 19, 2026
  • Unable To Get Advertised Op-Amp Slew Rate January 19, 2026
  • Op amp shock January 19, 2026
  • My Advanced Realistic Humanoid Robots Project January 18, 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