avov
Newbie level 3
- Joined
- Apr 30, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,315
Hello,
Can some one explain me how to sort out the fault - LED.h:3:Error: syntax error. I can't see any syntax error in LED.h file:-(
In my LED.h file is the following code:
here is LED.c file
And here is main.c file:
Thank you in advance.
Can some one explain me how to sort out the fault - LED.h:3:Error: syntax error. I can't see any syntax error in LED.h file:-(
In my LED.h file is the following code:
Code:
extern void InitialiseLED(void);
extern void LED_Off(void);
extern void LED_On(void);
here is LED.c file
Code:
#include <p18cxxx.h>
void InitialiseLED(void)
{
TRISB = 0xF0; // In binary 0b1111000 four higher bits - input; four lower bits - output
}
void LED_Off(void)
{
PORTB&=(~0x01); //Turn LED0 off; first bitwise NOT (11111110); second bitwise AND (00000000 AND 11111110); result - 00000000
}
void LED_On(void)
{
PORTB|=0x01; // Turn LED0 on; bitwise OR need to add (00000000 OR 00000001); result - 00000001
}
And here is main.c file:
Code:
#include <LED.h>
void main(void)
{
InitialiseLED();
LED_Off();
LED_On();
while(1){};// pause execution here
}
Thank you in advance.