Hello everybody.
I would like to implement the atmega328 as a low voltage disconnect. I
Have the voltage divider set up, works and reads what it is supposed to. I was wondering which code to use so if it reads say 800 or below (pin low) 800 or above (pin high). Something like the code below. Is it as simple as that?
if (pinFiveInput > 800) { // do Thing A } else if (pinFiveInput < 800) { // do Thing B
}
I would like to implement the atmega328 as a low voltage disconnect. I
Have the voltage divider set up, works and reads what it is supposed to. I was wondering which code to use so if it reads say 800 or below (pin low) 800 or above (pin high). Something like the code below. Is it as simple as that?
if (pinFiveInput > 800) { // do Thing A } else if (pinFiveInput < 800) { // do Thing B
}