1.- Now after doing at the touch screen, joy reef had take the value correctly, maybe a joy reef bug? cause last times I have do it at the web directly.
2.- the tab stamps is correct, and I hadn´t made any change at this tab and it was working correctly till last sunday
3.- I have change from 8Gb to 2Gb and it´s working with the same EC error as previously (and also I have change it after selecting the temp probe with the touch screen, so it doesn´t seem to be a SD size problem as I hadnt have it before.
4.- understood, I have change all values to 0 in order to avoid the graph.
stamps tab (As i mentioned I haven´t change it since the joyreef code update and it have been working fine till this weekend when the ferduino reset by herself and after that all the values star to show the problems I had mentioned, and this problem had occured ramdonly at the past.
//------------------------------------- Leitura dos stamps
void check_parametro_ph_aquario()
{
boolean done = false;
byte holding;
char sensorstring[15];
do{
Open_channel(ph1);
delay(50);
while(Serial3.available())
{
char c = Serial3.read();
}
Serial3.print("T,");
Serial3.print(tempC);
Serial3.print('\r');
delay(1000);
Serial3.print("R"); // Envia um comando.
Serial3.print('\r');
delay(1000);
if(Serial3.available() > 3)
{
holding = Serial3.available();
for(byte i=1; i <= holding; i++)
{
sensorstring[i]= Serial3.read();
}
if(holding == 6)
{
PHA = ((sensorstring[1]-48)*100 + (sensorstring[3]-48)*10 + (sensorstring[4]-48));
PHA /= 100;
}
else
{
PHA = ((sensorstring[1]-48)*1000 + (sensorstring[2]-48)*100 + (sensorstring[4]-48)*10 + (sensorstring[5]-48));
PHA /= 100;
}
Serial3.flush();
break;
}
}
while (done == true);
}
/*
void check_parametro_ph_reator()
{
boolean done = false;
byte holding;
char sensorstring[15];
do{
Open_channel(ph2);
delay(50);
Serial3.print(tempC); //Para se obter um valor compensado pode-se enviar um valor de temperatura da água.
Serial3.print('\r');
delay(500);
if(Serial3.available() > 3)
{
holding = Serial3.available();
for(byte i = 1; i <= holding; i++)
{
sensorstring[i]= Serial3.read();
}
if(holding == 5)
{
PHR = ((sensorstring[1]-48)*100 + (sensorstring[3]-48)*10 + (sensorstring[4]-48));
PHR /= 100;
}
else
{
PHR = ((sensorstring[1]-48)*1000 + (sensorstring[2]-48)*100 + (sensorstring[4]-48)*10 + (sensorstring[5]-48));
PHR /= 100;
}
Serial3.flush();
break;
}
}
while (done == true);
}
void check_parametro_orp()
{
boolean done = false;
byte holding;
char sensorstring[15];
do{
Open_channel(orp);
delay(50);
Serial3.print("r"),
Serial3.print('\r');
delay(500);
if(Serial3.available() > 3)
{
holding = Serial3.available();
for(byte i = 1; i <= holding; i++)
{
sensorstring[i]= Serial3.read();
}
if(holding == 5)
{
ORP = ((sensorstring[1]-48)*10 + (sensorstring[2]-48));
}
else
{
ORP = ((sensorstring[1]-48)*100 + (sensorstring[2]-48)*10 + (sensorstring[3]-48));
}
Serial3.flush();
break;
}
}
while (done == true);
}
*/
void check_parametro_densidade()
{
boolean done = false;
byte holding;
char sensorstring[15];
do{
Open_channel(ec);
delay(50);
while(Serial3.available())
{
char c = Serial3.read();
}
Serial3.print("T,");
Serial3.print(tempC);
Serial3.print('\r');
delay(1000);
Serial3.print("R"); // Envia um comando.
Serial3.print('\r');
delay(1000);
if(Serial3.available() > 3)
{
holding = Serial3.available();
for(byte i=1; i <= holding; i++)
{
sensorstring[i]= Serial3.read();
}
if(holding == 6)
{
DEN = ((sensorstring[1]-48)*1000 + (sensorstring[3]-48)*100 + ((sensorstring[4]-48)*10) + (sensorstring[5]-48));
}
Serial3.flush();
break;
}
}
while (done == true);
}
void iniciar_stamp_ph_aquario()
{
Open_channel(ph1);
delay(50);
Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
Serial3.print('\r');
delay(1000);
Serial3.flush();
Serial3.print("L,1"); // Envia um comando para que o "stamp" apague o led de depuração.
Serial3.print('\r');
delay(1000);
check_parametro_ph_aquario();
}
/*
void iniciar_stamp_ph_reator()
{
Open_channel(ph2);
delay(50);
Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
Serial3.print('\r');
delay(1000);
Serial3.flush();
Serial3.print("L0"); // Envia um comando para que o "stamp" apague o led de depuração.
Serial3.print('\r');
delay(1000);
check_parametro_ph_reator();
}
void iniciar_stamp_orp()
{
Open_channel(orp);
delay(50);
Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
Serial3.print('\r');
delay(1000);
Serial3.flush();
Serial3.print("L0"); // Envia um comando para que o "stamp" apague o led de depuração.
Serial3.print('\r');
delay(1000);
check_parametro_orp();
}
*/
void iniciar_stamp_densidade()
{
Open_channel(ec);
delay(50);
Serial3.print("O,EC,0"); // Envia um comando para que o "stamp" desactive la salida d evalor EC
Serial3.print('\r');
delay(1000);
Serial3.print("O,S,0"); // Envia um comando para que o "stamp" desactive la salida d evalor S
Serial3.print('\r');
delay(1000);
Serial3.print("O,TDS,0"); // Envia um comando para que o "stamp" desactive la salida d evalor TDS
Serial3.print('\r');
delay(1000);
Serial3.print("K,10"); // Envia um comando para que o "stamp" asigne la lectura de valor k=10 (agua dsalada)
Serial3.print('\r');
delay(1000);
Serial3.print("e"); // Envia um comando para que o "stamp" pare de enviar as leituras.
Serial3.print('\r');
delay(1000);
Serial3.flush();
Serial3.print("L,1"); // Envia um comando para que o "stamp" apague o led de depuração.
Serial3.print('\r');
delay(1000);
check_parametro_densidade();
}
void Open_channel(short channel)
{
switch (channel)
{
case 0:
//open channel Y0
//S0=0
//S1=0
digitalWrite(multiplexadorS0Pin, LOW);
digitalWrite(multiplexadorS1Pin, LOW);
break;
case 1:
//open channel Y1
//S0=1
//S1=0
digitalWrite(multiplexadorS0Pin, HIGH);
digitalWrite(multiplexadorS1Pin, LOW);
break;
case 2:
//open channel Y2
//S0=0
//S1=1
digitalWrite(multiplexadorS0Pin, LOW);
digitalWrite(multiplexadorS1Pin, HIGH);
break;
case 3:
//open channel Y3
//S0=1
//S1=1
digitalWrite(multiplexadorS0Pin, HIGH);
digitalWrite(multiplexadorS1Pin, HIGH);
break;
}
Serial3.print('\r');
return;
}