I have my sketch that the OneWire and DallasTemperature portions are nearly identical to this other thread, however when I try to upload it I get:
In file included from C:\Program Files (x86)\Arduino\libraries\DallasTemperatureControl/DallasTemperature.h:22:0,
from Aquaponics_Control_Computer_New.ino:2:
C:\Program Files (x86)\Arduino\libraries\OneWire/OneWire.h:108:2: error: #error "Please define I/O register types here"
C:\Program Files (x86)\Arduino\libraries\OneWire/OneWire.h:115:5: error: 'IO_REG_TYPE' does not name a type
C:\Program Files (x86)\Arduino\libraries\OneWire/OneWire.h:116:14: error: 'IO_REG_TYPE' does not name a type
This is my sketch:
]#include <DallasTemperature.h>
#include <OneWire.h>
//Parts list
const int TTempGOOD = 12;
const int MTempGOOD = 11;
const int pHGOOD = 10;
const int TTempBAD = 0;
const int MTempBAD = 1;
const int pHBAD = 2;
#define TilapiaTemp 23;
#define MainTemp 22;
//Variables
int pH = 6;
int TTemp = 75;
int MTemp = 75;
//Misc
OneWire oneWire1(23);
OneWire oneWire2(22);
DallasTemperature sensors1(&oneWire1);
DallasTemperature sensors2(&oneWire2);
void setup() {
pinMode(TTempGOOD, OUTPUT);
pinMode(TTempBAD, OUTPUT);
pinMode(MTempGOOD, OUTPUT);
pinMode(MTempBAD, OUTPUT);
pinMode(pHGOOD, OUTPUT);
pinMode(pHBAD, OUTPUT);
Serial.begin(9600);
Serial.println("Luke's Aquaponics Progran");
sensors1.begin();
sensors2.begin();
}
void loop() {
Serial.println("Requesting Temperatures...");
sensors1.requestTemperatures();
sensors2.requestTemperatures();
Serial.println("");
Serial.print("Tilapia Tank Temperature is... ");
Serial.println(sensors1.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
Serial.print("Main Tank Tenperatire is... ");
Serial.println(sensors2.getTempCByIndex(0));
Serial.println("");
Serial.println("");
if (TTemp < 80.1 && TTemp >74.9){
digitalWrite(TTempGOOD, HIGH);
}
else{
digitalWrite(TTempBAD, HIGH);
}
if (MTemp < 80.1 && MTemp > 74.9){
digitalWrite(MTempGOOD, HIGH);
}
else{
digitalWrite(MTempBAD, HIGH);
}
if (pH < 6.6 && pH > 5.4){
digitalWrite(pHGOOD, HIGH);
}
else{
digitalWrite(pHBAD, HIGH);
}
}
Does anyone know what I am doing wrong?