motors
This commit is contained in:
@@ -7,9 +7,9 @@ Servo auxServo;
|
|||||||
|
|
||||||
std::vector<MOTOR_PINS> motorPins =
|
std::vector<MOTOR_PINS> motorPins =
|
||||||
{
|
{
|
||||||
{32, 33}, //RIGHT_MOTOR Pins (IN1, IN2)
|
{RMOTOR_IN1, RMOTOR_IN2}, //RIGHT_MOTOR Pins (IN1, IN2)
|
||||||
{26, 25}, //LEFT_MOTOR Pins
|
{LMOTOR_IN1, LMOTOR_IN2}, //LEFT_MOTOR Pins
|
||||||
{19, 22}, //ARM_MOTOR pins
|
{ARM_IN1, ARM_IN2}, //ARM_MOTOR pins
|
||||||
};
|
};
|
||||||
|
|
||||||
void setUpPinModes()
|
void setUpPinModes()
|
||||||
@@ -23,8 +23,8 @@ void setUpPinModes()
|
|||||||
moveCar(STOP, false);
|
moveCar(STOP, false);
|
||||||
bucketServo.attach(bucketServoPin);
|
bucketServo.attach(bucketServoPin);
|
||||||
auxServo.attach(auxServoPin);
|
auxServo.attach(auxServoPin);
|
||||||
auxControl(150);
|
auxControl(default_auxControl);
|
||||||
bucketTilt(140);
|
bucketTilt(default_bucketTilt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rotateMotor(int motorNumber, int motorDirection)
|
void rotateMotor(int motorNumber, int motorDirection)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <ESP32Servo.h> //by Kevin Harrington
|
#include <ESP32Servo.h> //by Kevin Harrington
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#define RIGHT_MOTOR 1
|
#define RIGHT_MOTOR 1
|
||||||
#define LEFT_MOTOR 0
|
#define LEFT_MOTOR 0
|
||||||
@@ -13,10 +13,6 @@
|
|||||||
#define FORWARD 1
|
#define FORWARD 1
|
||||||
#define BACKWARD -1
|
#define BACKWARD -1
|
||||||
|
|
||||||
#define bucketServoPin 23
|
|
||||||
|
|
||||||
#define auxServoPin 17
|
|
||||||
|
|
||||||
#define UP 1
|
#define UP 1
|
||||||
#define DOWN 2
|
#define DOWN 2
|
||||||
#define LEFT 3
|
#define LEFT 3
|
||||||
@@ -36,7 +32,6 @@ struct MOTOR_PINS
|
|||||||
void setUpPinModes();
|
void setUpPinModes();
|
||||||
void moveCar(int inputValue, bool horizontal);
|
void moveCar(int inputValue, bool horizontal);
|
||||||
|
|
||||||
|
|
||||||
//motor functions
|
//motor functions
|
||||||
void rotateMotor(int motorNumber, int motorDirection);
|
void rotateMotor(int motorNumber, int motorDirection);
|
||||||
void setMomentum(bool val);
|
void setMomentum(bool val);
|
||||||
|
|||||||
Reference in New Issue
Block a user