|
Re: Connecting custom sensor to RC dig I/O
Quote:
Originally Posted by Mike.Allen
We too have run in to the same problem. Could you please explain the "the extra software!"
-thanks
|
A simple comparison function should do it.
Code:
{
char a;
if (rc_ana02 <= 615)
{
a = 0;
{
else
{
a = 1;
}
}
This just looks at an analog input and assigns a value of 0 to a variable if the input is less than a threshold, otherwise the variable is set to 1.
I chose 615 because the analog inputs to the RC are 10 bit, or, 1024 values. 615 is 60% of 1024, the same as 3 volts is 60% of the reference 5 volts.
__________________
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
|