I'm trying to put all my settings in a config.h file and then #include
it in the Arduino sketch.
Here's what my config.h looks like:
RobotConfig.h
#ifdef BOT
//hardware pins
int motor1Pin = 9; //s0
int motor2Pin = 10; //s1
//pins for light
int light2 = A4;
int light3 = A2; //right
int light1 = A1; //left
And here's what .ino sketch looks like:
#define BOT
#include "RobotConfig.h"
void setup() {
//Light INIT
pinMode(light1, OUTPUT); //left light with motor1/s1 in front
pinMode(light2, OUTPUT); //middle light with motor1/s1 in front
pinMode(light3, OUTPUT); //right light with motor1/s1 in front
...
}
This compiles fine on my Mac but I'm trying to compile this on Raspberry Pi (Pi3 with new Jessie install with sudo apt-get install arduino
) and get an error while doing so. The error says:
A1 was not declared in the scope etc.
What am I missing?
#endif
in RobotConfig.h ? If so, please edit your question to show it