What does this mean ?

Discussion in 'Programmer's Corner' started by HArvey Levi, Aug 15, 2016.

  1. HArvey Levi

    Thread Starter New Member

    Aug 2, 2016
    3
    0
    #define_XTAL_FREQ_20000000
    #define RS RD2
    #define EN RD3
    #define D4 RD4
    #define D5 RD5
    #define D6 RD6
    #define D7 RD7
    #include<pic.h>
    #include<htc.h>
    #include<stdio.h>
    #include<string.h>
    #include<xc.h>
    #include "lcd.h";
    #include "uart.h";
    #include<pic16f877a.h>

    #pragma config FOSC=HS // Oscillator Selection bits (HS oscillator)
    #pragma config WDTE=OFF // Watchdog Timer Enable bit (WDT enabled)
    #pragma config PWRTE=OFF // Power-up Timer Enable bit (PWRT disabled)
    #pragma config BOREN=ON // Brown-out Reset Enable bit (BOR enabled)
    #pragma config LVP=OFF
    #pragma config CPD=OFF
    #pragma config WRT=OFF
    #pragma config CP=OFF

    void main()
    {
    while(1)
    {

    //char,irfid[10]"0007143195";

    char i,rfid[];
    TRISD=0x00;
    Lcd_Init();
    Lcd_Clear();
    Lcd_Set_Cursor(1,1);
    Lcd_Write_String("Scan Your Card");

    UART_Init(9600);

    for(i=0;i<5;)
    { if(UART_Data_Ready())
    {
    rfid=UART_Read();
    i++;

    }
    }
    if(rfid[0]^rfid[1]^rfid[2]^rfid[3]==rfid[4])
    {
    unsigned long number=0;
    char rfidnumber[10];

    if(rfid[10]!=0){
    number=number+rfid[0];
    number=number<<24;}
    number=number+rfid[1];
    number=number<<16;
    unsigned long number2=0;
    number2=number2+rfid[2];
    number2=number2<<8;
    number2=number2+rfid[3];
    number=number+number2;

    sprintf(rfidnumber,"%lu",number);
    Lcd_Clear();
    Lcd_Set_Cursor(1,1);
    Lcd_Write_String(rfidnumber);
    if(strcmp(rfidnumber,"7143195")==0)
    {
    Lcd_Set_Cursor(2,1);
    Lcd_Write_String("Identified Tag");
    _delay_ms(2000);
    }
    else
    {
    Lcd_Set_Cursor2(2,1);
    Lcd_Write_String("Unknown Tag");
    _delay_ms(2000);
    }
    }
    else
    {
    Lcd_Set_Cursor(2,1);
    Lcd_Write_String("Error Reading");
    _delay_ms(2000);
    }
    }
    }
     
  2. HArvey Levi

    Thread Starter New Member

    Aug 2, 2016
    3
    0
    hi. im not good in programming and not even know how to program. i need help in this situation which i want to use for my final year project. and its really confuse me. i follow up the code that have been given. but it seem to have problem with #include<uart.h> and <lcd.h> . which it say not found. can anyone please kindly help me here? :D thanks
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,364
    It means it is looking for files on your computer and cannot find them.

    Search your computer for the files:
    uart.h
    lcd.h

    #include "uart.h" means that it is looking for file uart.h in your directory that you are working in.

    #include <uart.h> means that it will search the systems directory.

    If you don't have these files on your computer, get them from the source where you got your compiler.
     
  4. HArvey Levi

    Thread Starter New Member

    Aug 2, 2016
    3
    0
    so does it mean i have to add the file in the header ? thanks for previous reply
     
  5. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    So let me get this straight -- you are working on YOUR final year project and you are using code that you got from someplace (i.e., that you didn't write) and you don't have the faintest idea what it is or what it does or how to use it. So just what will this final year project tell your instructor about whether YOU deserve to graduate?
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,793
    I have an answer for this question, but I'm pretty sure it will not enjoy universal popularity.
     
    nsaspook likes this.
  7. wayneh

    Expert

    Sep 9, 2010
    12,150
    3,058
    I haven't heard it but I like it already. :p
     
  8. ci139

    Member

    Jul 11, 2016
    341
    38
    some disciplines are must have aside your main - i don't think there a problem - how 1 get's those done - if the person never more get involved with those :p (muhahahahaaa) - if they later need it - they have heared something about it in lectures or at allaboutcircuits ???
     
  9. MrSoftware

    Active Member

    Oct 29, 2013
    504
    124
    Assuming your major is not programming (if it is then you should know these errors):

    The errors mean the compiler cannot find the header (.h) files. You're including them with quotes, "", which means the compiler is expecting to find them in the same directory as the rest of your source code files. First check your computer to make sure you have those files. If you do then either (1) copy them to the same directory as the rest of your source code files, or (2) change your compiler search path settings to include the directory where they are located and then include them using <> instead of "".
     
Loading...