Continue to Site

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.

  • 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.

lcd display

Status
Not open for further replies.

naz83

New Member
Hi all

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....

plz hekp

Thanks
 
Have you tried the lib of Peter Fleury too?
**broken link removed**
**broken link removed**

I've it not tested, bud it should be work great.
 
Hi wkrug

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

// No MUX values needed to be changed to use ADC0

ADCSRA |= (1 << ADATE); // Set ADC to Free-Running Mode
ADCSRA |= (1 << ADEN); // Enable ADC
ADCSRA |= (1 << ADSC); // Start A2D Conversions

/* 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);



if(ADCH < 128)
{
PORTB|= (1 << 2); // Turn on LED1
PORTC &= ~(1 << 0); // Turn off LED2
}

else
{
PORTB &= ~(1 << 2); // Turn off LED1
PORTC|= (1 << 0); // Turn on LED2
}

}

}
 
It looks beautyful, but where ist the lcd_init() comand ?

Ist the Port defination ok - Ar the Ports connected in the right way for the library ?

Look into description before use the library.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top