Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 9941dc7

Browse files
Added relay functionality
1 parent cc6b160 commit 9941dc7

File tree

4 files changed

+87
-6
lines changed

4 files changed

+87
-6
lines changed
178 KB
Loading

arduino_controller/arduino_controller.ino

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
#define DEBOUNCE_TIME .4
66
#define SAMPLE_FREQUENCY 20
77
#define MAXIMUM (DEBOUNCE_TIME * SAMPLE_FREQUENCY)
8-
#define NUMBER_MOTORS 9
8+
#define NUMBER_MOTORS 1
99

10-
// function declarations
10+
// relay pin
11+
int relayPin = 53;
12+
13+
// function declarations`
1114
void RecvWithStartEndMarkers();
1215
void ProcessData();
1316
int CheckSwitch();
@@ -21,8 +24,9 @@ bool new_data = false;
2124
// initialize motors
2225
Servo my_servo[NUMBER_MOTORS];
2326
// create a array of ports with the order: motor, counter, reset
24-
int ports[NUMBER_MOTORS][3] = {{2, 3, 4}, {5, 6, 7}, {8, 9, 10}, {11, 12, 13}, {22, 23, 24}, {25, 26, 27}, {28, 29, 30}, {31, 32, 33}, {34, 35, 36}};
25-
27+
int ports[NUMBER_MOTORS][3] = {{34, 35, 36}};
28+
// int ports[NUMBER_MOTORS][3] = {{2, 3, 4}, {5, 6, 7}, {8, 9, 10}, {11, 12, 13}, {22, 23, 24}, {25, 26, 27}, {28, 29, 30}, {31, 32, 33}, {34, 35, 36}};
29+
// int ports[NUMBER_MOTORS][3] = {{2, 3, 4}, {5, 6, 7}, {8, 9, 10}, {11, 12, 13}, {22, 23, 24}, {25, 26, 27}};
2630
// integer array that contains the direction and number of rotations a motor
2731
// needs to go
2832
int motor_commands[NUMBER_MOTORS][2] = {0};
@@ -45,6 +49,9 @@ void setup()
4549
// setup serial port
4650
Serial.begin(9600);
4751

52+
// initialize relay pin
53+
pinMode(relayPin, OUTPUT);
54+
4855
// initialize all motor ports
4956
Serial.println("Begining Initialization");
5057
Serial.print("Motor Ports: ");
@@ -102,6 +109,8 @@ void loop()
102109
Serial.println("<");
103110
Serial.print("Arduino: ");
104111
Serial.println(received_chars);
112+
digitalWrite(relayPin, HIGH);
105113
ProcessData();
114+
digitalWrite(relayPin, LOW);
106115
}
107-
}
116+
}

arduino_controller/arduino_controller_functions.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ int CheckSwitch(int motor_number, int switchPort)
185185
return (1);
186186
integrator[motor_number] = MAXIMUM; /* defensive code if integrator got corrupted */
187187
}
188-
}
188+
}

oshpark-2layer.dru

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
description[en] = <b>OSH Park Design Rules</b>\n<p>\nPlease make sure your boards conform to these design rules.\n</p>\n<p>\nNote, that not all DRC settings must be set by the manufacturer. Several can be adjusted for the design, including those listed on our docs page here. \n<a href="http://docs.oshpark.com/design-tools/eagle/design-rules-files/">Adjustable Settings</a>\n</p>
2+
layerSetup = (1*16)
3+
mtCopper = 0.035559375mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.035559375mm
4+
mtIsolate = 1.6mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm
5+
mdWireWire = 6mil
6+
mdWirePad = 6mil
7+
mdWireVia = 6mil
8+
mdPadPad = 6mil
9+
mdPadVia = 6mil
10+
mdViaVia = 6mil
11+
mdSmdPad = 6mil
12+
mdSmdVia = 6mil
13+
mdSmdSmd = 6mil
14+
mdViaViaSameLayer = 8mil
15+
mnLayersViaInSmd = 2
16+
mdCopperDimension = 15mil
17+
mdDrill = 6mil
18+
mdSmdStop = 0mil
19+
msWidth = 6mil
20+
msDrill = 10mil
21+
msMicroVia = 10mil
22+
msBlindViaRatio = 0.500000
23+
rvPadTop = 0.250000
24+
rvPadInner = 0.250000
25+
rvPadBottom = 0.250000
26+
rvViaOuter = 0.250000
27+
rvViaInner = 0.250000
28+
rvMicroViaOuter = 0.250000
29+
rvMicroViaInner = 0.250000
30+
rlMinPadTop = 5mil
31+
rlMaxPadTop = 20mil
32+
rlMinPadInner = 5mil
33+
rlMaxPadInner = 20mil
34+
rlMinPadBottom = 5mil
35+
rlMaxPadBottom = 20mil
36+
rlMinViaOuter = 5mil
37+
rlMaxViaOuter = 20mil
38+
rlMinViaInner = 5mil
39+
rlMaxViaInner = 20mil
40+
rlMinMicroViaOuter = 5mil
41+
rlMaxMicroViaOuter = 20mil
42+
rlMinMicroViaInner = 5mil
43+
rlMaxMicroViaInner = 20mil
44+
psTop = -1
45+
psBottom = -1
46+
psFirst = -1
47+
psElongationLong = 100
48+
psElongationOffset = 100
49+
mvStopFrame = 1.000000
50+
mvCreamFrame = 0.000000
51+
mlMinStopFrame = 2.5mil
52+
mlMaxStopFrame = 2.5mil
53+
mlMinCreamFrame = 0mil
54+
mlMaxCreamFrame = 0mil
55+
mlViaStopLimit = 0mil
56+
srRoundness = 0.000000
57+
srMinRoundness = 0mil
58+
srMaxRoundness = 0mil
59+
slThermalIsolate = 10mil
60+
slThermalsForVias = 0
61+
dpMaxLengthDifference = 10mm
62+
dpGapFactor = 2.500000
63+
checkAngle = 0
64+
checkFont = 1
65+
checkRestrict = 1
66+
checkStop = 0
67+
checkValues = 0
68+
checkNames = 1
69+
checkWireStubs = 1
70+
checkPolygonWidth = 0
71+
useDiameter = 13
72+
maxErrors = 50

0 commit comments

Comments
 (0)