could u plz guide me as to which library i need to use for the lcd, and also which functions/commands do i need to use to write to an adc the recult from ADCH register after performing adc.......where do i need to save the library to or to which file or folder should i add it to.... i have tried several things but they dint compile....
I tried peter flurrys library.. my code seems to compile fine but nothing is dispalyed on my lcd in my avr board...... here is the code that i have writted, it compiled fine but when i loaded the hexx file to my avr board nothing s displayed on the lcd...
#include <avr/io.h>
#include "lcd.h"
int main (void)
{
char buffer[7];
int num ;
DDRB |= (1 << 2); // Set LED1 as output
DDRC = (1 << 0); // Set LED2 as output
ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); // Set ADC prescalar to 128 - 125KHz sample rate @ 16MHz
ADMUX |= (1 << REFS0); // Set ADC reference to AVCC
ADMUX |= (1 << ADLAR); // Left adjust ADC result to allow easy 8 bit reading
/* turn on cursor */
lcd_command(LCD_DISP_ON_CURSOR);
//Clear the screen
/* clear display and home cursor */
lcd_clrscr();
for(; // Loop Forever
{
ADCH = num ;
/* convert interger into string */
itoa( num , buffer, 10);
lcd_puts("The velocity is \n");
/* put converted string to display */
lcd_puts(buffer);