Professional Documents
Culture Documents
New Text Document
New Text Document
New Text Document
BTS7960B
If you found this tutorial helpful, please support me so I can continue creating
content like this. You can support me on Patreon http://robojax.com/L/?id=63
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define CW 1 //
#define CCW 0 //
#define debug 1 //
#include <RobojaxBTS7960.h>
RobojaxBTS7960 motor1(R_EN_1,RPWM_1,R_IS_1, L_EN_1,LPWM_1,L_IS_1,debug);//define
motor 1 object
RobojaxBTS7960 motor2(R_EN_2,RPWM_2,R_IS_2, L_EN_2,LPWM_2,L_IS_2,debug);//define
motor 2 object and the same way for other motors
void setup() {
// BTS7960 Motor Control Code by Robojax.com 20190622
Serial.begin(9600);// setup Serial Monitor to display information
motor1.begin();
motor2.begin();
void loop() {
// BTS7960 Motor Control Code by Robojax.com 20190622
motor1.rotate(100,CW);// run motor 1 with 100% speed in CW direction
delay(5000);//run for 5 seconds
motor1.stop();// stop the motor 1
delay(3000);// stop for 3 seconds
motor1.rotate(100,CCW);// run motor 1 at 100% speed in CCW direction
delay(5000);// run for 5 seconds
motor1.stop();// stop the motor 1
delay(3000); // stop for 3 seconds