|
Re: 4V - 5V signal on Digital Input
Quote:
Originally Posted by tdlrali
Thanks guys, I'll look into those options. The only reason we don't want to use analogs is because we're really just looking for on vs. off, and the additional sampling required for using an analog input is overkill.
|
It may be overkill, but if the custom circuit's output does not operate such that it meets the designed parameters of the RC, then you need to adjust your approach.
An analog comparison will only take a couple lines of code.
Code:
{
char a;
{
if (Get_analog_01() <= 800)
{
a = 0;
}
else
{
a = 1;
}
}
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
|