I am sure it is some syntax I am doing. Oddly enough, if I change all the booleans to say, longs, it compiles ok.
I removed the logic out of the .cpp and the main file to make my troubleshooting easier.
At this point I am stuck, so any help is appreciated.
This is all in Arduino 11
error:
(more or less saying every byte and boolean definition is an issue)
C:\arduino-0011-win\tmp\/tank.h:24: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h:25: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h:26: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h: In constructor 'deviceStatus::deviceStatus()':
C:\arduino-0011-win\tmp\/tank.h:29: error: 'powerON' was not declared in this scope
C:\arduino-0011-win\tmp\/tank.h:30: error: 'environmentOK' was not declared in this scope
C:\arduino-0011-win\tmp\/tank.h:31: error: 'programmingError' was not declared in this scope
C:\arduino-0011-win\tmp\/tank.h: At global scope:
C:\arduino-0011-win\tmp\/tank.h:38: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h:57: error: variable or field 'writeLEDMask' declared void
C:\arduino-0011-win\tmp\/tank.h:57: error: 'byte' was not declared in this scope
C:\arduino-0011-win\tmp\/tank.h:63: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h:64: error: 'boolean' does not name a type
C:\arduino-0011-win\tmp\/tank.h:67: error: 'boolean' does not name a type
.pde (main window):
#include <Wire.h>
#include "tank.h"
//remove later, for testing
byte mask1 = B10101010;
byte mask2 = B01010101;
//used to toggle status light
long counter = 0;
byte statusMask;
char* dow[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup() {
Wire.begin();
Serial.begin(9600);
// shift register (LED) outputs
pinMode(SHIFT_REGISTER_CLOCK, OUTPUT);
pinMode(SHIFT_CLOCK, OUTPUT);
pinMode(SHIFT_OUT, OUTPUT);
pinMode(LIGHT_POWER, OUTPUT);
pinMode(HUM_POWER, OUTPUT);
}
void loop() {
}
.h:
#define SHIFT_OUT 4
#define SHIFT_REGISTER_CLOCK 5
#define SHIFT_CLOCK 6
#define SENSOR_CLOCK 2
#define SENSOR_DATA 3
#define LIGHT_POWER 7
#define HUM_POWER 8
#define readHumMask B00000101
#define readTempMask B00000011
#define clearMask B00011110
#define readStatusMask B00000111
#define writeStatusMask B00000110
#define softResetMask B00011110
#define heatOn B00000100
#define heatOff 0
class deviceStatus {
public:
boolean powerON;
boolean environmentOK;
boolean programmingError;
deviceStatus() {
powerON = false;
environmentOK = false;
programmingError = false;
}
};
typedef struct {
double temp;
double humidity;
boolean readError;
} envStatus;
typedef struct {
int hour;
int minute;
int second;
int month;
int day_of_week;
int day;
int year;
} time;
// TIME
void readTime(time *retTime);
// STATUS DISPLAY
void writeLEDMask(byte mask);
// SHT15
void readSensor(envStatus *retEnv);
double convertHumidity(int data);
double convertTemperature(int data);
boolean turnHeatOn();
boolean turnHeatOff();
int readMeasurement();
int readRegister();
boolean writeByte(byte output);
int readByte();
int shiftIn();
void transmissionStart();
void clearInterface();
.cpp:
#include "tank.h"
#include <Wire.h>