I guess each dose-node has one uint32_t count and two uint32_t times?
each has 1 for doseUPcount and doseDOWNcount.
So it is always one up cycle followed by one down cycle?
Why do you want to count both then?
i count them to be sure i dont have any bugs causing the dose pumps to keep cycling when i didnt expect them to, the pumps handle highly corrosive chemicals that can cause major problems. so i like the counter so i can tell whats going on. its either dose up or dose down in no specific order. the counter should be incremented after the end of the dose cycle
These are what? The commands to set up/down times? Which should be?
A time sets a variable? There is only one pump? Which three? Commands?
there are 2 pumps each has its own independent runTime in the range of ms,
id like to be able to set the runTimes from the control panel.
I see a 'go up/down' 'setTime up/down' in my crystal ball.
yea that's pretty much it
The outside will have no idea what the state of the system is with that information.
idle? up dose? down dose? pump? But who cares.
i would like the dose pump modules to broadcast their counter to the control panel without ack. i want the commands sent from the control panel ack. in the end i will be collecting all this information on the multicast pipe and displying it on an lcd screen and other processing
It's hard to get specifications from you.
BTW what are the ranges of the times/count? How do you want to handle power failures?
i will have power failures handled by storing the on times and other variable in the EEPROM.
I had sent a command STt1g and it works. but the timer code is not updating the control panel to let me know timer 1 is on
this is basically the whole program for the dose,
const int dosingPump1 = 4; //2.2k ohm
const int dosingPump2 = 5;
float phIsHigh = 123.123;
float phIsLow = 321.321;
unsigned long respondDelay2 = 0;
unsigned long doseUpCounter = 0;
unsigned long doseDownCounter = 0;
unsigned long doseDownOnMarker = 0;
unsigned long doseUpOnMarker = 0;
int phUPState = 0;
int phDOWNState = 0;
unsigned long doseDownTime1 = 1700;
unsigned long doseUpTime1 = 1700;
void setup() {
Serial.begin(57600);
Serial.println("hello");
pinMode(dosingPump1, OUTPUT);
pinMode(dosingPump2, OUTPUT);
}
void loop() {
if (phDOWNState == 1) {
digitalWrite(dosingPump2, HIGH);
if (millis() - doseDownOnMarker > doseDownTime1) {
digitalWrite(dosingPump2, LOW);
phDOWNState = 0;
doseDownCounter++;
}
}
if (phUPState == 1) {
digitalWrite(dosingPump1, HIGH);
if (millis() - doseUpOnMarker > doseUpTime1) {
digitalWrite(dosingPump1, LOW);
phUPState = 0;
doseUpCounter++;
}
}
}
im sorry the ranges of timer count should be the same unsigned long integer