So I am trying to edit up some code for an OPC-N2 and a DHT humidity sensor.
I had some working code for both and am bringing them together, however a part of the code that was running fine is now returning this error message:
exit status 1
'PowerOn' was not declared in this scope
I'm not sure what has changed... Maybe I am missing something but scrolling between the code that is working and the slightly edited one, there is no difference with the OPC power section of the code.
Will attach section that is broken here:
void setup() {
//This will power on the OPC and allow enough time for fan and laser to reach optimum power
boolean OPCPowerResult;
Serial.begin(9600);
SPI.begin();
pinMode(SSPin, OUTPUT);
pinMode(OPCInput, INPUT);
//setup and add header to the output file on the sd card
SD.begin(4);
File myFile = SD.open("file_1.txt", FILE_WRITE);
myFile.println("#Alphasense OPC-N2 PM Data and bin data averaged over a 1 minute period");
myFile.println("#Seconds since power on[s],PM1[ug/m^3],PM2.5[ug/m^3],PM10[ug/m^3],Bin0,Bin1,Bin2,Bin3,Bin4,Bin5,Bin6,Bin7,Bin8,Bin9,Bin10,Bin11,Bin12,Bin13,Bin14,Bin15");
myFile.println("#The bin's are counts of the size of particle detected, see OPC-N2 manual for more details on particle sizes recorded in these");
myFile.println("#This code was produced by R.Pound as part of summer placement in 2016");
myFile.close();
delay(5000);
//attempt to set the OPC to power on mode
OPCPowerResult=PowerOn();
if (OPCPowerResult != true){
delay(1000); //allow additional time for the OPC before attempting comminication again
OPCPowerResult = PowerOn();
if (OPCPowerResult != true){
delay(70000); //allow the OPC to reset and then attempt connection again
OPCPowerResult = PowerOn();
if (OPCPowerResult != true){
Serial.println("NEED POWER CYCLE");
}
}
}
//allow time for the fan and laser to reach full power
delay(6000);