|
Re: Arduino and kop encoder
Quote:
Originally Posted by SeanPerez
Has any one used the encoder included in the KOP with the arduino? can someone give me the code for it so i can read the rpm?
Thanks
|
I can give you code, but wouldn't you learn more by doing the research and writing your own?
Let me push you in the right direction and see how far you can go. Don't be surprised if you learn to fly along the way.
The first thing you want to learn is how to use the "interrupt" input(s), more specifically, "External Interrupt". One channel of the encoder will go to that input. The other channel will be used to determine direction.
Your interrupt service routine will sample that input. High would be forward, otherwise it's reverse.
RPM after that is simply a little math.
OK, that's enough hints for now. Let us know what you find. I'll always help you out if you just ask.
__________________
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
Last edited by billbo911 : 04-25-2012 at 09:45 AM.
|