problem with #include

Discussion in 'Embedded Systems and Microcontrollers' started by muhammad muhsin, Mar 16, 2010.

  1. muhammad muhsin

    Thread Starter New Member

    Mar 16, 2010
    is it there is easiest programming?i mean im not study the programming with start with #define..
    now my main problem is the programming part..
    can anybody help me..i have 3 weeks to complete this robot..
    could anybody send or teach me the source code..please...
  2. BMorse

    Senior Member

    Sep 26, 2009
    #include and #define are 2 different statements used in assembly programming.

    #include is used when you want the compiler to include an external file when it compiles your program: Example

    #include = means that you want the compiler to include this file when compiling your application or program into a hex file.

    #define is used when you want to refer to a say a port bit or value with a specific name: example:

    #define Button PORTA,0 = you are telling the compiler you want to refer to this port bit with the name Button, so now when you write code and you want to reference PORTA bit0, you will just refer to Button instead. (btfss Button, instead of writing btfss PORTA,0)

    I hope this helps clear some things up for you.

    B. Morse
  3. russ_hensel

    Well-Known Member

    Jan 11, 2009
    #include and #define are also part of C and C++
    something like them is included in most languages.