Components Required –
Block Diagram –
How the circuit works –
Programming Guide –
Project Source Code
###
//Program to #ifndef _ADC_H_ #define _ADC_H_ 1 #include<avr/io.h> #include<util/delay.h> void adc_init(void); // This function is declared to read the digital value of the ADC conversion int read_adc_channel(unsigned char channel); /*Function definations*/ void adc_init(void) { ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2); SFIOR=0x00; } int read_adc_channel(unsigned char channel) { int adc_value; unsigned char temp; ADMUX=(1<<REFS0)|channel; _delay_ms(1); temp=ADCL; adc_value=ADCH; adc_value=(adc_value<<8)|temp; return adc_value; } #endif
//ICD Header File
#ifndef _LCD_H_
#define _LCD_H_ 1
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#ifndef LCD_DATA_PORT
#warning "LCD_DATA_PORT not defined for <avr/lcd.h.Default Port is PORTA>"
#define LCD_DATA_PORT PORTB
#endif
#ifndef LCD_CONT_PORT
#warning "LCD_CONT_PORT not defined for <avr/lcd.h.Default Port is PORTB>"
#define LCD_CONT_PORT PORTD
#endif
#ifndef LCD_RS
#warning "LCD_RS not defined for <avr/lcd.h.Default Pin is PD0>"
#define LCD_RS PD0
#endif
#ifndef LCD_RW
#warning "LCD_RW not defined for <avr/lcd.h.Default Pin is PD1>"
#define LCD_RW PD1
#endif
#ifndef LCD_EN
#warning "LCD_EN not defined for <avr/lcd.h.Default Pin is PD2>"
#define LCD_EN PD2
#endif
void lcd_data_write(char data);
void lcd_command_write( char command);
void lcd_init();
void lcd_string_write( char *string);
void lcd_number_write(int number,unsigned char radix);
void lcd_data_write(char data)
{
LCD_CONT_PORT=_BV(LCD_EN)|_BV(LCD_RS);
LCD_DATA_PORT=data;
_delay_ms(1);
LCD_CONT_PORT=_BV(LCD_RS);
_delay_ms(1);
}
void lcd_command_write(char command)
{
LCD_CONT_PORT=_BV(LCD_EN);
LCD_DATA_PORT=command;
_delay_ms(1);
LCD_CONT_PORT=0x00;
_delay_ms(1);
}
void lcd_init()
{
lcd_command_write(0x38);
lcd_command_write(0x01);
lcd_command_write(0x06);
lcd_command_write(0x0e);
}
void lcd_string_write(char *string)
{
while (*string)
lcd_data_write(*string++);
}
void lcd_number_write(int number,unsigned char radix)
{
char *number_string="00000";
itoa(number,number_string,radix);
lcd_string_write(number_string);
}
#endif###
Circuit Diagrams
Circuit-Diagram-Receiver-Side-AVR-Gesture-Controlled-Wireless-Robot | |
Circuit-Diagram-Transmitter-Side-AVR-Gesture-Controlled-Wireless-Robot |
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.