Commit 839ace76 authored by Beck-Sisyphus's avatar Beck-Sisyphus
Browse files

Arm motor fully controlled and programmable

parent e724fab1
No preview for this file type
No preview for this file type
......@@ -8,9 +8,17 @@ void setup() {
Serial.begin(BAUD_RATE);
motor1.attach(motorPin1);
motor2.attach(motorPin2);
// set up the arm to steady
for(int i = 0; i < 3; i++) {
armMotor[i].attach(TALON_ARM[i]);
armMotor[i].writeMicroseconds(NEUTRAL_FREQUENCY);
}
}
void loop() {
driveMotorFullSpeed();
getReadingFromCurrentSensor();
// driveMotorFullSpeed();
// getReadingFromCurrentSensor();
armRiseAndBack();
delay(100);
}
......@@ -20,5 +20,5 @@ void driveMotorFullSpeed() {
motor1.writeMicroseconds(1500);
motor2.writeMicroseconds(1500);
}
delay(10);
// delay(10);
}
// Apr 18, 2015. Husky Robotics, made by Electrical Team
// Using Analog read from current sensor ACS758
#include <Arduino.h>
void armRiseAndBack() {
for(int i = 0; i < 3; i++) {
armMotor[i].writeMicroseconds(SPEEDUP_FREQUENCY);
Serial.println(TALON_ARM[i]);
delay(5000);
armMotor[i].writeMicroseconds(SPEEDDOWN_FREWQUENCY);
delay(5000);
armMotor[i].writeMicroseconds(NEUTRAL_FREQUENCY);
}
}
......@@ -2,14 +2,25 @@
#include <Arduino.h>
#include <Servo.h>
// Need Analog input with male pin
const int BAUD_RATE = 9600;
int currentSensorPin = A1;
const int currentSensorPin = A1;
int potPin = A0;
int potValue;
int sendValue;
// Need PWM input with male pin for motor controller
// connect to RS232
Servo motor1;
Servo motor2;
int motorPin1 = 3;
int motorPin2 = 5;
const int motorPin1 = 12;
const int motorPin2 = 13;
// Need PWM input with male pin for the direct arm motor controller
// Talon Senior
Servo armMotor[3];
const int TALON_ARM[3] = {2, 3, 4};
const int NEUTRAL_FREQUENCY = 1500;
const int SPEEDUP_FREQUENCY = 1750;
const int SPEEDDOWN_FREWQUENCY = 1250;
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