The attachment below are the errors that are shown when I run the simulation. Can anyone highlight to me what I've done wrong? Thanks in advance.

This my program:

#pragma config OSC = IRCIO67

#pragma config WDT = OFF

#pragma config LVP = OFF

#pragma config PBADEN = OFF

#define SW0 PORTAbits.RA0

#define SW1 PORTAbits.RA1

#define SW2 PORTAbits.RA2

#define SW3 PORTAbits.RA3

#define LOW PORTCbits.RC0

#define MEDIUM PORTCbits.RC1

#define HIGH PORTCbits.RC2

void main()

{

TRISA = 1;

PORTA = 0;

TRISC = 0;

PORTC = 0;

while (1)

{

if(SW0 == 1)

{

LOW = 0;

MEDIUM = 0;

HIGH = 0;

}

if ((SW0 == 0)&&(SW1 == 1)&&(SW2 == 0)&&(SW3 == 0))

{

LOW = 1;

MEDIUM = 0;

HIGH = 0;

}

if ((SW0 == 0)&&(SW1 == 0)&&(SW2 == 1)&&(SW3 == 0))

{

LOW = 0;

MEDIUM = 1;

HIGH = 0;

}

if ((SW0 == 0)&&(SW1 == 0)&&(SW2 == 0)&&(SW3 == 1))

{

LOW = 0;

MEDIUM = 0;

HIGH = 1;

}

}

}

Below are the errors that are shown when I run the simulation.

More Nur Diyanah's questions See All
Similar questions and discussions