Moderadores: andre_luis, 51, guest2003, Renie
[/code]ddspereira escreveu:Olá estou tentando compilar codigo de um Voltimetro está dando o seguinte erro:
324 Undeclared identifier 'LCD_config' in expression
324 Undeclared identifier 'LCD_CURSOR_OFF' in expression
324 Undeclared identifier 'LCD_CLEAR' in expression
o PIC é 16F877A
Compilador MIKROC PRO
segue o codigo
--------------------------------------------------------------------------------------
unsigned long value;
unsigned char d1,d2,d3,d4,*text;
#define printV lcd_chr(2,11,d1+48); lcd_chr_cp(d2+48); \
lcd_chr_cp('.'); lcd_chr_cp(d3+48); \
lcd_chr_cp(d4+48); lcd_out_cp("V");
void main()
{
adcon1=0b10000010;
trisa=0xff;
LCD_config(&portb, 1,3,2,7,6,5,4);
LCD_cmd(LCD_CURSOR_OFF);
LCD_cmd(LCD_CLEAR);
text=("Diogo");
lcd_out(1,2,text);
text=("voltagem");
lcd_out(2,1,text);
for(;;)
{
value=adc_read(0);
value=value*5000/1023;
d1=value/1000,
d2=(value%1000)/100;
d3=((value%1000)%100)/10;
d4=((value%1000)%100)%10;
printV;
delay_ms(20);
}
}
--------------------------------------------------------------------------------------
obrigado!
Diogo Pereira
unsigned long value;
unsigned char d1,d2,d3,d4,*text;
#define printV lcd_chr(2,11,d1+48); lcd_chr_cp(d2+48); \
lcd_chr_cp('.'); lcd_chr_cp(d3+48); \
lcd_chr_cp(d4+48); lcd_out_cp("V");
void main()
{
adcon1=0b10000010;
trisa=0xff;
LCD_config(&portb, 1,3,2,7,6,5,4);
LCD_cmd(LCD_CURSOR_OFF);
LCD_cmd(LCD_CLEAR);
text=("Diogo");
lcd_out(1,2,text);
text=("voltagem");
lcd_out(2,1,text);
for(;;)
{
value=adc_read(0);
value=value*5000/1023;
d1=value/1000,
d2=(value%1000)/100;
d3=((value%1000)%100)/10;
d4=((value%1000)%100)%10;
printV;
delay_ms(20);
}
}
--------------------------------------------------------------------------------------
obrigado!
Diogo Pereira[/quote]
// Lcd pinout settings
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
//fim
Lcd_Init();
unsigned long value;
unsigned char d1,d2,d3,d4,*text;
#define printV lcd_chr(2,11,d1+48); lcd_chr_cp(d2+48); \
lcd_chr_cp('.'); lcd_chr_cp(d3+48); \
lcd_chr_cp(d4+48); lcd_out_cp("V");
void main()
{
adcon1=0b10000010;
trisa=0xff;
Lcd_Init();
LCD_cmd(_LCD_CURSOR_OFF);
LCD_cmd(_LCD_CLEAR);
text=("Diogo");
lcd_out(1,2,text);
text=("voltagem");
lcd_out(2,1,text);
for(;;)
{
value=adc_read(0);
value=value*5000/1023;
d1=value/1000,
d2=(value%1000)/100;
d3=((value%1000)%100)/10;
d4=((value%1000)%100)%10;
printV;
delay_ms(20);
}
}
fabim escreveu: ... Agora é fazer média.
tira 5 amostras, somando as 5 em tempo X, depois pega esta amostra e divide por 5, depois amostra no display.
Resolveu ? sim.
fabim escreveu: Uma coisa que diferencia um designer de um outro técnico é a visão espacial.
Agora é fazer média.
tira 5 amostras, somando as 5 em tempo X, depois pega esta amostra e divide por 5, depois amostra no display.
Resolveu ? sim.
Djalma Toledo Rodrigues escreveu:fabim escreveu: Uma coisa que diferencia um designer de um outro técnico é a visão espacial.
Agora é fazer média.
tira 5 amostras, somando as 5 em tempo X, depois pega esta amostra e divide por 5, depois amostra no display.
Resolveu ? sim.
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante