Commit 5fdf6d38 authored by Beck-Sisyphus's avatar Beck-Sisyphus
Browse files

Add more constants for more servo

parent 839ace76
No preview for this file type
No preview for this file type
......@@ -6,6 +6,7 @@
void setup() {
Serial.begin(BAUD_RATE);
Serial1.begin(BAUD_RATE);
motor1.attach(motorPin1);
motor2.attach(motorPin2);
......@@ -17,8 +18,11 @@ void setup() {
}
void loop() {
// driveMotorFullSpeed();
// Pass in the pot value from 0 to 1023
driveMotorFullSpeed(1023);
// getReadingFromCurrentSensor();
armRiseAndBack();
delay(100);
}
......@@ -3,19 +3,16 @@
// Dual motor, only forwards and backwards
#include <Arduino.h>
void driveMotorFullSpeed() {
// For Joystick
// potValue = analogRead(potPin);
void driveMotorFullSpeed(int potValue) {
// For motor current testing
potValue = 1023;
// PWM have pulse seconds from 1000 microseconds to 2000
sendValue = map(potValue, 0, 1023, 1250, 1750);
if (sendValue < 1480 || sendValue > 1520)
{
motor1.writeMicroseconds(sendValue);
motor2.writeMicroseconds(sendValue);
motor2.writeMicroseconds(-sendValue);
} else {
motor1.writeMicroseconds(1500);
motor2.writeMicroseconds(1500);
......
......@@ -24,3 +24,6 @@ const int TALON_ARM[3] = {2, 3, 4};
const int NEUTRAL_FREQUENCY = 1500;
const int SPEEDUP_FREQUENCY = 1750;
const int SPEEDDOWN_FREWQUENCY = 1250;
// Turn table continous rotation servo
const int CONT_SERVO_CENTER 80 //in degrees
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment