MICRO-C Software "split source code"

Discussion in 'Embedded Systems and Microcontrollers' started by Moelsayed, Jan 13, 2018.

  1. Moelsayed

    Thread Starter New Member

    Dec 12, 2017
    16
    0
    Dear All,

    Please I need to split my code into several source codes files in ( MICRO -C) program .
    how can I do something like that please.

    by the way I added one external source file into my project but I couldn't use the function which is created in this external source file ( to use it in main source file ).

    So please i need your help.

    Thanks.
    Moelsayed
     
  2. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    4,512
    4,783
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    6,645
    2,925

    Just do it. Tshat is how.Break things down into logic functions. I have files for lcd, switches, lights, sensors etc. My function name starts with the file name.

    For example lcd_Init() initializes the lcd panel. lcd_Write(char *str) writes to the lcd panel etc.
     
  4. Moelsayed

    Thread Starter New Member

    Dec 12, 2017
    16
    0
    please could you give me a detailed steps to show me how can i add ( source file & header file )
    if you have a small project created by MICRO-C PRO. it will be helpful for me

    Thanks in advance.
    Moelsayed
     
  5. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    6,645
    2,925
    You just create the files and place an include statement at the top of the file for the header files needed. This is an EXTREMELY basic and simple procedure. If you ned thatr level of help then you need a whole lot more training then can be provided here. I suggest you seek out an online training for C.
     
Loading...