Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
hello,
i want to light on a led for a specific temperature and wanna show the temperature through 16*2 LCD display.. i am using atmega16 and LM35 temperature sensor.. could anyone help me with C code for this... i am so new with micro controller.. i badly need help...
What have you started with? There are hordes of basic example code for C available simply by using Google and following some simple tutorials. If you want help try something and come here for questions after you atempt it.
Project : LM35 دماسنج ترموستات
Version : 1.0
Date : 04/21/2012
Author :
Company :
Comments: پروژه الکترونیک ARM AVR PIC LPC STM32
Chip type : ATmega16A
Program type : Application
AVR Core Clock frequency: 8.000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 256
*****************************************************/
#include <mega16a.h>
#include <delay.h>
// Alphanumeric LCD functions
#include <alcd.h>
#define ADC_VREF_TYPE 0xC0
// Read the AD conversion result
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
// Declare your global variables here
void main(void)
{
// Declare your local variables here
unsigned int temp;
// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTA=0x00;
DDRA=0x00;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.