I was compiling SONAR_0.3 using MPLAB C18 and it was not successful.
Followings are the errors detected from the codes in sonar.c.
At function initialize_sonar()
1) SONAR_OUTPUT_CONFIG = OUTPUT
-->symbol 'TRISJbits' has not been defined
-->struct or union object designator expected
-->lvalue required
2) SONAR_OUTPUT = 0
-->symbol 'LATJbits' has not been defined
-->struct or union object designator expected
-->lvalue required
At function ping_sonar ()
3) SONAR_OUTPUT = 1
-->symbol 'LATJbits' has not been defined
-->struct or union object designator expected
-->lvalue required
4) SONAR_OUTPUT = 0
-->symbol 'LATJbits' has not been defined
-->struct or union object designator expected
-->lvalue required
I thought maybe the problem lies with the definition in sonar.h for both SONAR_OUTPUT_CONFIG and SONAR_OUTPUT (see following 2 lines)
# define SONAR_OUTPUT rc_dig_out16
# define SONAR_OUTPUT_CONFIG digital_io_16
It seems to me that the define statements is referring to the hardware part or maybe the MPLAB C18 compiler is unable to read it?
Would anyone reading this can share which compiler they use and how to go about solving this problem?
pls help. Thank you.
