![]() |
pwm controlled by relay
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.
|
Re: pwm controlled by relay
You can use relays to control motors, but you wont have the speed control that using a PWM value would give you.
When you program it assign a button to forward and reverse Code:
relay1_fwd = p1_sw_aux1; |
Re: pwm controlled by relay
Quote:
Code:
if (p1_sw_top && !p1_sw_trig) |
Re: pwm controlled by relay
We have to do the same thing, but we have to have the motor turn one direction all the time and the other only when the button is pressed.
Code:
if(p2_sw_aux1 == 1) |
Re: pwm controlled by relay
I think I should be a little more specific, we want to be able to switch from one set up to another by the push of a button, but we can't find a way to switch pwms through that. All of our if statements haven't worked, is there a way to assign for example, tank drive to trigger and arcade mode to aux?
|
Re: pwm controlled by relay
You could use static variables to achieve these means.
Code:
static unsigned char Tank_Drive = 1; //default is tank drive |
Re: pwm controlled by relay
Quote:
Quote:
|
| All times are GMT -5. The time now is 00:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi