Properly using separate tabs with Arduino IDE I'm trying to split up a large project of mine into separate tabs in the Arduino IDE and I'm having more than a few troubles with it. My main trouble is finding a way to have routines in extra tabs access the Serial object; because it's really hard to debug things with Serial.println() otherwise. All I get, though, is "'Serial' was not declared in this scope".
There appears to be some kind of trick to this? I've noticed that "byte" or "bool" needs to be declared in .cpp tabs and .h tabs but not on the main one?
Is there some kind of easy way to set this up so that I don't need to constantly #include &lt;stdbool.h&gt; and typedef unsigned char byte;?

Current issue: Main file:

void setup() {
  Serial.begin(500000);
  PrintMessage();
}

void loop() {
}


driver.ino file:

byte PrintMessge () {
  Serial.println("printin");
}


and on compiling:

error: 'PrintMessage' was not declared in this scope


EDIT: Found a silly typo. Problem solved.
This question is more about C/C++ header basics rather than Arduino. Anyways, you should have the following file structure: Code in .cppfiles, Header in .h files. Main sketch either .ino or .cpp (for cpp remember that you must explicitly write out the function prototypes!)

So for your small example that would be:

main.ino:

#include "driver.h"
void setup() {
  Serial.begin(500000);
  PrintMessage();
}

void loop() {
}


driver.cpp 

#include "driver.h"
byte PrintMessage () {
  Serial.println("printin");
  return 0; //previously had no return although returning 'byte'.
}


driver.h 

 //Always use include guards
 #ifndef DRIVER_H
 #define DRIVER_H

 #include &lt;Arduino.h&gt;
 //All function prototypes from driver.cpp.
 byte PrintMessage();

 #endif /* DRIVER_H */


Also corrected a typo from PrintMessge to PrintMessage. This is the "professional" way to do it, seperate implementation and header files.