errors in my code.Hi friends iam new to PIC programming , I'm coding my pic in mikroC pro , please help me out.. iam attaching my file with this!the code i want is message from transceiver should receiver and check whether the message is ON or OFF then pic should function on my output accordingly!

  • \$\begingroup\$ Those red lines indicate Errors \$\endgroup\$
    – MaNyYaCk
    Jul 19 '18 at 6:27
  • \$\begingroup\$ I know those are errors, but can u please verify my code and guide me how to do? \$\endgroup\$ Jul 19 '18 at 6:33
  • \$\begingroup\$ Without knowing your environment, it's difficult, but at first glance you have no includes so the compiler has no way to find ANSEL etc. \$\endgroup\$
    – awjlogan
    Jul 19 '18 at 10:50
  • \$\begingroup\$ Please don't post code as screenshot. \$\endgroup\$ Aug 1 '18 at 10:56

The compiler doesn't know what the variables TRISABITS etc are, which means you didn't tell the compiler about them. This is usually done by including the appropriate file given by Microchip. For example, in my header files I have:

#include <p18f47j13.h>  // For a PIC18F47J13

It might be easier to use MPLAB X from Microchip and use their project wizard to start your project. MPLAB X will make sure that the mentioned include file is there.

  • \$\begingroup\$ ok thank you so much! MPLAB X i will check it once \$\endgroup\$ Jul 19 '18 at 6:45
  • \$\begingroup\$ It's not problem at all. Please mark answers as "Accepted", and upvote if you are happy with it. :) \$\endgroup\$ Jul 19 '18 at 7:02

use MPLABx + xc8 compiler (both are for free). Know include xc.h header in every source file. That should work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.