Updated: 5/17/21


MOTOR DRIVER SECTION:


MOTOR CONNECTIONS:

Left Motor:Blue Wire [1A] - (B), Yellow Wire [1B] - (U)
Right Motor: Black Wire [2B] - (B), Green Wire [2A] - (U)
| Top View                                                                                                                                                                                              |  Bottom View

PBOT 2018 FUNCTIONS: REVIEW

  • Set Motor Directions:

PBOT.DIRECTION(whichmotor, dir);

  • where: whichmotor MOTOR_A or MOTOR_BMOTOR_BOTHdir = MOTOR_FWDMOTOR_REV.

Ex: 

  • Set Motor Speeds:

PBOT.SPEED(whichmotor,speed);

  • where: whichmotor = MOTOR_A or MOTOR_BMOTOR_BOTHspeed 0 to 255

Ex:

GET STARTED:

Setting up your Arduino IDE with ArduBlocks and the eGizmo_PBOT2018 library. (Read Here):

  1.  In ArduBlock, using PBOT 2018,

START WITH ADDING A BLOCK "PBOT BEGIN":

Adding PBOT BEGIN Block - setting up the eGizmo_PBOT2018 Wire library and turn ON all the motors.


SERIAL MONITOR BY ADDING THE SERIAL PRINT BLOCK:


Send message via Serial port


// MOVE FORWARD


Motors forward at 120 PWM speed in 2secs.

// REVERSER MOTORS

Motors reverse at 120 PWM speed in 2secs.

// TURN RIGHT


Motor A turning right at 120 PWM speed in 2secs.

// TURN LEFT


Motor B turning left at 120 PWM speed in 2secs.

// MOTOR STOPS


Both Motor stops at 0 speed in 2 secs.

// EXTREME RIGHT

Motor A forward and Motor B reverse at 120 PWM speed in 2secs.

// EXTREME LEFT


Motor A reverse and Motor B forward at 120 PWM speed in 2secs.

  • MOTOR_TEST.ino

/**********************************************
e-Gizmo PBOT2018 Controller - MOTOR_TEST.ino
This is for motor sample sketch to controls
and move forward, reverse, turning right,
turning left, and stop the motors.
Set motor speed:
PBOT.SPEED(whichmotor, speed);
Note: Forward Speed = 0 Full Stop;255 High, limit 250
Where:
whichmotor = MOTOR_A or MOTOR_B, MOTOR_BOTH
speed = 0 to 255
Set motor direction:
PBOT.DIRECTION(whichmotor, dir);
Where:
whichmotor = MOTOR_A or MOTOR_B, MOTOR_BOTH
dir = MOTOR_FWD, MOTOR_REV;
Codes by
e-Gizmo Mechatronix Central
http://www.e-gizmo.com
June 5,2018
************************************************/
#include "eGizmo_PBOT2018.h"
#include <Wire.h>
eGizmo_PBOT2018 PBOT;
int SPEED = 120; //Set Speeds to 120 PWM
void setup() {
Wire.begin();
PBOT.BEGIN();
PBOT.ALLON(); //Turn on all motors
// Need for intial start of motors
PBOT.SPEED(MOTOR_BOTH, 120);
}
void loop() {
//Move Forward
PBOT.DIRECTION(MOTOR_BOTH, MOTOR_FWD);
PBOT.SPEED(MOTOR_BOTH, 120);
delay(2000);
//Reverse
PBOT.DIRECTION(MOTOR_BOTH, MOTOR_REV);
PBOT.SPEED(MOTOR_BOTH, 120);
delay(2000);
//Turn Right
PBOT.DIRECTION(MOTOR_A, MOTOR_FWD);
PBOT.SPEED(MOTOR_A, 120);
PBOT.SPEED(MOTOR_B, 0);
delay(2000);
//Turn Left
PBOT.DIRECTION(MOTOR_B, MOTOR_FWD);
PBOT.SPEED(MOTOR_B, 120);
PBOT.SPEED(MOTOR_A, 0);
delay(2000);
//Stop
PBOT.SPEED(MOTOR_BOTH, 0);
delay(2000);
//Extreme Right
PBOT.DIRECTION(MOTOR_A, MOTOR_FWD);
PBOT.DIRECTION(MOTOR_B, MOTOR_REV);
PBOT.SPEED(MOTOR_BOTH, 120);
delay(2000);
//Extreme Left
PBOT.DIRECTION(MOTOR_A,MOTOR_REV);
PBOT.DIRECTION(MOTOR_B,MOTOR_FWD);
delay(2000);
}
view rawMOTOR_TEST.ino hosted with ? by GitHub