I am using 16*1 Lcd display with pic16f877a ,I want to display "hello" in full screen.
The codes in assembly and ccs c are welcome.
My simulation in Proteus has been added here.
I want to display " Hello" alone and then display " World"after the first cleared and so on meanwhile displaying a world at a time and in using only one line not 2 lines mode.
You have to save the adc result in an int variable and then convert the int or float value to string and display it on lcd.[/QUOTENormally,I know how to do ADC and display for example on seven segment but now I want to display on LCD see the code below for example on seven segment display it on LCD:
#include<16f877a.h>
#device ADC = 10 // Need to tell compiler ADC is configured for 10-bit reading
#fuses HS,NOWDT
#use delay(clock=20000000)
#include<stdio.h>
#include<STDLIB.H>
#use standard_io(A)
#use standard_io(B)
#use standard_io(D)
#define PORTB
#DEFINE PORTC
#define PORTA
byte const digit[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
char display[2];
int value;
unsigned long volt;
unsigned int value2;
void main(){
set_tris_A(0xFF);
set_tris_B(0X00);
set_tris_D(0x00);
output_b(0);
output_d(0);
setup_comparator(NC_NC_NC_NC);
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0);
set_adc_channel(0);
setup_vref(FALSE);
while(TRUE){
delay_us(100);
//value=read_adc(); //Not required
read_adc(ADC_START_ONLY);
delay_us(100);
value=read_adc(ADC_READ_ONLY);
volt=(value*500)/1023; //I changed this part of the code
value2=volt;
output_low(PIN_D1);
display[0]=value2/10;
output_high(PIN_D0);
output_B(digit[display[0]]);
delay_ms(10);
output_low(PIN_D0);
display[1]=value2%10;
output_high(PIN_D1);
output_B(digit[display[1]]);
delay_ms(10);
}
}
Thanks
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?