Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

INCLUDE syntax

Status
Not open for further replies.

MrDEB

Well-Known Member
file won't load??
Code:
}
Device = 18F1320
Clock = 8 // 8MHz clock
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Include "timermodule4.bas"

tried checked spelling etc.
in the timer module4 it has another sub file as well
Code:
// 18F1320@ 8MHz - they are just used here for clarity...
Device = 18F1320
Clock = 8

Include "ISRTimer.bas"

can I do this or do I need to put the INCLUDE only on one bas file? not two as I have it.
 

kchriste

New Member
Forum Supporter
Usually when the include file is in "quotes" like that then the file must reside in the same directory as the source file which references it. Either that, or you can specify the full path to the file.
When the include file is in <brackets> created by the greater/lesser than symbols the file should reside in the include directory specified by the compiler configuration.
What compiler are you using?
 

MrDEB

Well-Known Member
using swordfish

I really want to do this as a module but I might find it easier to just copy n paste?
I put the module in same directory as the ISRtimer figuring it should load.
strike 2!
will play with it as it is a learning experience.
 

MrDEB

Well-Known Member
I looked at the ISRtimer module

first code was MODULE
I tried doing same on my module but it didn't like it??
something missing when creating a module. What I havn't found out as yet.
been trying different things.
next thing I need is to have a way to make an OR statment.
have pin 9 (connected to PIR, triggers on LOW) then another pin that changes state. both pins trigger the PIC but pin 9 is disabled during daylight.
plan is a photo transistor connected to pin 9.
see schematic.
idea is the photo transistor disables the pin 9 during daylight and at night the PIR takes over and the timer is disabled.
 

Attachments

  • Capture6-9-2009-3.30.24 PM.gif
    Capture6-9-2009-3.30.24 PM.gif
    56.3 KB · Views: 62

Pommie

Well-Known Member
Most Helpful Member
My 2c on includes, I believe that if you save the file in the same directory (folder) as your main file it will work.

If you put it in the Library folder it will work.

If you put it in the UserLibrary folder it will work.

Mike.
 

be80be

Well-Known Member
Mike your right on all three that is if it's a module. One file he is trying to use is not it's the
sample code. Can't use it as module.
The timermodule4.bas was the name I think of the sample I posted. It used sordfish timer
module.
 
Last edited:

MrDEB

Well-Known Member
I put in same folder=library

it still came up with not a valid module.
How does one make a module??
I tried putting MODULE at the beginning but it still did not reconize as a module.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top