// Keep track of milliseconds elapsed.
CurrentTimer = millis();
You don't use this variable anywhere.
i did use it before, then i replaced it directly with millis() function was trying to sort out the bug.
These if statements probably do their stuff all on the same loop, or with very little delay between, maybe change the initial timing or try to use 'else if' statements only match one of the conditions per iteration of loop.
Initial timing meaning, more than 1000UL, or how should i do that, i will try with if else statement in the meanwhile.
Thanks . .
Why do you believe your output pins aren't changing? I think they are, but you won't see it without
an oscilloscope since they change for about 0.1ms every second.
You are right, that's why this explain the rapid fluctuations on my voltmeter on pin 13, but for pin 12 only some mV are able to be detected.
From serial output, i can have reading on analog pin in forward direction of current but constant value of 1023 while in reverse direction.
You have three timer variables yet they run in perfect lockstep since they have the same delay, thus
every time they get to fire up their code sections they all run, leaving both output pins LOW. Why
three variables?
Here is part of the code from 'Gardenbot' and taking account with some threads on this forum, for soil moisture which i brought some modifications, with its original delay timer function.
const int timer = 1000;
digitalWrite(voltageFlipPin01, HIGH);
digitalWrite(voltageFlipPin02, LOW);
delay(Timer);
Moist_Val01 = analogRead(Moisture_Input_0);
delay(Timer);
digitalWrite(voltageFlipPin01, LOW);
digitalWrite(voltageFlipPin02, HIGH);
delay(Timer);
Moist_Val02 = 1023 - analogRead(Moisture_Input_0);
Moist_Avg01 = (Moist_Val01 + Moist_Val02) / 2;
digitalWrite(voltageFlipPin01, LOW);
digitalWrite(voltageFlipPin02, LOW);
Any help will be appreciated. .
Thanks