Alguem pode corrigir meu codigo please?
Nao sei o que esta acontecendo !!
(SEGUE EM ANEXO CIRCUITO FEITO NO PROTEUS )
Quando pressionar o botão mudar o estado de RB0 = 0 para 1
Codigo :
// Lcd pinout settings
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D4 at RB4_bit;
// Pin direction
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D7_Direction at TRISB7_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB4_bit;
bit estado;
void main() {
ADCON1=0x0F;
Lcd_Init();
TRISB.RB0 = 0;
TRISB.RB1 = 1;
PORTB.RB0 = 0;
Lcd_Out(1,1, "Pic Mikro C");
Lcd_Cmd(_LCD_CURSOR_OFF);
if (PORTB.RB0 == 0);
Lcd_Out (2,2, "Pic18F4520");
if (PORTB.RB0 == 0);
Lcd_Out (2,2, "Programacao");
if ((Button(&PORTB,1,500,0) && (estado == 0))){
PORTB.RB0=~PORTB.RB0;
estado = 1;
}
if ((Button(&PORTB,1,500,1)&& (estado == 1))) {
estado = 0;
}
}
PicPiscador.DSN
PicPiscador.PWI