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 / hi sandeeb,actually a program

hi sandeeb,actually a program

|

Microcontroller › AVR › Help regarding Digital Thermometer › hi sandeeb,actually a program

March 5, 2013 at 2:02 am #9241
adip
Participant

hi sandeeb,

actually a program in this site in microcontrollers-avr is avialable.

i have pasted it below.

only thing is you need a interfacing diagram which is a single pin of LM 35 going to microcontroller and the rest 2 are vcc and ground.

you can get diagram from net.

i think it will work.

if the below code does not work in some software try to change the header file.

 

 

 

 // Program to take input from a particular pin in AVR Microcontroller (ATmega16) #include<avr/io.h> #include<util/delay.h>

int main (void)
{
      unsigned int i=0;
      DDRA=~_BV(PA0);   // PA0 as input pin
      PORTA=0x00;
      DDRD=0xff;

while(1)
      {
            PORTD=0x01;
            while(PORTD!=0)
            {
                  if(bit_is_set(PINA,PA0))       //If PA0=1
                  {
                        _delay_ms(100);

if(bit_is_set(PINA,PA0))//Check it again due to swithc debouncing
                        PORTD=(PORTD<<1);        //Left shift value of PORTD by 1
                 
                  }
                 
            }
      }
}

RSS Recent Posts

  • Smart Buoy project May 15, 2026
  • Need Guidance to reduce noise in 3-stage Transimpedance amplifier May 15, 2026
  • Wall Radiator Heating: Efficiency and Placement Questions May 15, 2026
  • Parasitic Draw Question May 15, 2026
  • Phone Charger 5v to 12v May 14, 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