|
Re: pwm controlled by relay
Quote:
Originally Posted by captainking
in our code we want to be able to control pwms through buttons on the controller, but the only place we can find button commands are on relay blocks, and IF statements haven't worked for us so far, any ideas? Thanks in advance.
|
We have done exactly this in the past.
Code:
if (p1_sw_top && !p1_sw_trig)
{
pwm04 = 225;
}
else if (!p1_sw_top && p1_sw_trig)
{
pwm04 = 50;
}
else
{
pwm04 = 127;
}
__________________
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
|