Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Fonseca Yarochewsky
2014-15
Commits
839ace76
Commit
839ace76
authored
Apr 18, 2015
by
Beck-Sisyphus
Browse files
Arm motor fully controlled and programmable
parent
e724fab1
Changes
9
Hide whitespace changes
Inline
Side-by-side
.DS_Store
View file @
839ace76
No preview for this file type
Arduino Code/.DS_Store
View file @
839ace76
No preview for this file type
Arduino Code/MainMegaBoard/MainMegaBoard.ino
View file @
839ace76
...
...
@@ -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
);
}
Arduino Code/MainMegaBoard/MotorControllerCommunication.ino
View file @
839ace76
...
...
@@ -20,5 +20,5 @@ void driveMotorFullSpeed() {
motor1
.
writeMicroseconds
(
1500
);
motor2
.
writeMicroseconds
(
1500
);
}
delay
(
10
);
//
delay(10);
}
Arduino Code/MainMegaBoard/armControl.ino
0 → 100644
View file @
839ace76
// 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
);
}
}
Arduino Code/MainMegaBoard/megaBoardDefine.h
View file @
839ace76
...
...
@@ -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
;
Arduino Code/Science Station/.DS_Store
0 → 100644
View file @
839ace76
File added
Modified From Last Year/.DS_Store
View file @
839ace76
No preview for this file type
Modified From Last Year/FinalArduinoCode/.DS_Store
0 → 100644
View file @
839ace76
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment