Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does Pinguino.cc support #include files?
08-03-2016, 06:39 AM,
#1
Does Pinguino.cc support #include files?
Does Pinguino.cc support #include files?

I tried several simple examples where a put a custom routine in a .h and .c file and was unable to get it to work.
----------------
Thanks,
j
wzumwalt
 (\__/)
 (='.'=)
 (")_(")
Reply
08-03-2016, 10:45 AM,
#2
RE: Does Pinguino.cc support #include files?
I added a space after the #, before the include.

Untried in recent IDE.

John
Reply
09-03-2016, 06:07 PM, (This post was last modified: 10-03-2016, 04:04 AM by jwzumwalt.)
#3
RE: Does Pinguino.cc support #include files?
Thanks for the info. I still don't seem to get it to work.
Here is my current test that I cleaned up (and it does not work)...



---------------------
// led.pde
int state = 1;

#include "routine.h"

void setup() {
pinMode(GREENLED, OUTPUT);
}

void loop() {
blink();
delay(500);
}

---------------------
// routine.h
void blink(void);

---------------------
// routine.c
void blink(void) {

state = !state;
digitalWrite(GREENLED, state);
}
----------------
Thanks,
j
wzumwalt
 (\__/)
 (='.'=)
 (")_(")
Reply
10-03-2016, 11:04 AM,
#4
RE: Does Pinguino.cc support #include files?
You have no space.

John
Reply
11-03-2016, 10:13 AM,
#5
RE: Does Pinguino.cc support #include files?
(09-03-2016, 06:07 PM)jwzumwalt Wrote: // led.pde
#include "routine.h"
---------------------
// routine.h
---------------------
// routine.c

#include statement works in pde file.

I suspect that you are expecting the function in routine.c is included when you include routine.h but it doesn't wotk that way unless routine.c is compiled and routine.o is included in the project. I haven't tried IDE V12, but V11 (X.4) will not work with multiple source file.

You can add the whole contents of routine.c into routine.h and it should work as you expect.

DJ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)