Vai al contenuto
PLC Forum


problema con mikroc


limaciù

Messaggi consigliati

Dopo aver realizzato il programma usando il compilatore mikroc quando tento di trasformarlo in m hex mi da errore alla funzione "Lcd_Config" qualcuno puà aiutarmi il programma è questo sotto:

void main () {

char *testo1 = "PORTA BASCULANTE";

char *testo2 = "PORTA CHIUSA";

char *testo3 = "PORTA APERTA";

char *testo4 = "PORTA BLOCCATA";

Lcd_Config(&PORTB,1,2,3,4,5,6);

Delay_ms(50);

Lcd_Cmd(LCD_CLEAR);

Lcd_Out(1,1, testo1);

TRISA = 0X07;

while(1) {

if (PORTA& 0X01) Lcd_Out(1,1, testo2);// PORTA CHIUSA

PORTB = 0X40; //accende illuminazzione lcd su RB6

Delay_Cyc(10);

PORTB = 0;

PORTB = 0X80; //segnale sonoro su RB7

Delay_ms(50);

PORTB = 0;

if (PORTA& 0X02) Lcd_Out(1,1, testo3); //PORTA APERTA

PORTB = 0X40; //accende illuminzzione lcd su RB6

Delay_Cyc(10);

PORTB = 0;

PORTA = 0X08; //accende led verde su RA3

Delay_ms(100);

PORTA = 0;

PORTB = 0X80; //segnale sonoro su RB7

Delay_ms(50);

PORTB = 0;

if (PORTA& 0X04) Lcd_Out(1,1, testo4); //PORTA BLOCCATA

PORTB = 0X40; //accende illuminazzinoe lcd su RB6

Delay_Cyc(20);

PORTB = 0;

PORTA = 0X10; //accende led rosso su RB4

Delay_ms(100);

PORTA = 0;

PORTB = 0X80; //segnale sonoro su RB7

Delay_ms(50);

PORTB = 0;

while(PORTA&0X07) {};

}

}

Grazie a tutti .

Link al commento
Condividi su altri siti


Crea un account o accedi per commentare

Devi essere un utente per poter lasciare un commento

Crea un account

Registrati per un nuovo account nella nostra comunità. è facile!

Registra un nuovo account

Accedi

Hai già un account? Accedi qui.

Accedi ora
×
×
  • Crea nuovo/a...