'Byte' definition when including external files

Hi, I’m working on a project to autogenerate Arduino code, mainly for definitions, to be included in my programs and help speed up development. To use the blink program as an example, I want to achieve something like this:

Arduino program (Saved as “C:\Users\Paul\Documents\Arduino\IncludeTest\IncludeTest.ino”)

#include "C:\Users\Paul\Documents\Arduino\IncludeTest\Include.txt"
// note missing definition of 'led'

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

void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

External file: (Saved as “C:\Users\Paul\Documents\Arduino\IncludeTest\Include.txt”)

int led = 13;

Now this example works, but if I change the contents of the include file to this:

byte led = 13;

I get the error message: “error: ‘byte’ does not name a type”. Changing ‘byte’ to ‘uint8_t’ doesn’t solve the problem. Other type definitions do work though:

char: works
int: works
long: works
byte: doesn’t work
uint8: doesn’t work
uint8_t: doesn’t work

Does anyone know what the problem is? Is there a correct way to define an 8 bit unsigned byte in this situation?

char, int, and long are native C types. byte and uint8_t are not. uint8 isn’t a valid type on the Arduino.

Files that are to be included typically are saved with a .h extension, not a .txt extension.

What does this “program to auto generate Arduino code” do, exactly? Enabling verbose mode in the IDE, and looking at the cpp file that is produced from the ino file will probably reveal some surprises.

I'm writing a communications protocol for sharing variables between a PC program and an Arduino program, and a program for setting up new Arduino-PC shared projects. I'd like it to work something like this: I define the variables I want in a setup file. A third program reads the setup and generates code for the PC and Arduino programs, in the form of include files that define the shared variable names, locations and types. Then I write programs to use the autogenerated include files, without having to keep the variable lists identical for the two programs.

Anyway, I think I fixed my problem - 'unsigned char' seems to define an unsigned 8 bit integer, which is what I wanted. Thanks for nudging me to that solution.