@@ -22,29 +22,27 @@ void ProcessData()
22
22
{
23
23
if (motor_commands[i][0 ] == 0 )
24
24
{
25
+ // Move up
25
26
my_servo[i].write (80 );
26
- Serial.println (" Reached Up" );
27
27
is_reset = false ;
28
28
}
29
29
else if (motor_commands[i][0 ] == 1 )
30
30
{
31
+ // Move down
31
32
my_servo[i].write (100 );
32
- Serial.println (" Reached Down" );
33
33
is_reset = false ;
34
34
}
35
35
else if (motor_commands[i][0 ] == 2 )
36
36
{
37
+ // Don't Move
37
38
my_servo[i].write (90 );
38
- Serial.println (" Reached Stopped" );
39
39
is_reset = false ;
40
40
}
41
41
else if (motor_commands[i][0 ] == 3 )
42
42
{
43
- // Start moving pieces up
43
+ // Move Up for Reset
44
44
my_servo[i].write (80 );
45
- Serial.println (" Reached Reset" );
46
45
is_reset = true ;
47
- // call reset function (still needs to be written)
48
46
}
49
47
else
50
48
{
@@ -123,7 +121,8 @@ void ProcessData()
123
121
{
124
122
int reset_counter[NUMBER_MOTORS] = {0 };
125
123
126
- for (int i = 0 ; i < NUMBER_MOTORS; ++i) {
124
+ for (int i = 0 ; i < NUMBER_MOTORS; ++i)
125
+ {
127
126
reset_counter[i] = 1 ;
128
127
}
129
128
@@ -186,6 +185,8 @@ void PopulateArray()
186
185
// string
187
186
for (int i = 0 ; i < NUMBER_MOTORS; i++)
188
187
{
188
+
189
+ // we break everything in to pairs of values
189
190
int search1 = (i * 2 );
190
191
int search2 = ((i * 2 ) + 1 );
191
192
@@ -218,15 +219,15 @@ void PopulateArray()
218
219
}
219
220
220
221
// print array
221
- for (int i = 0 ; i < NUMBER_MOTORS; i++)
222
- {
223
- Serial.print (" Motor Number: " );
224
- Serial.print (i);
225
- Serial.print (" - Direction: " );
226
- Serial.print (motor_commands[i][0 ]);
227
- Serial.print (" - Rotations: " );
228
- Serial.println (motor_commands[i][1 ]);
229
- }
222
+ // for (int i = 0; i < NUMBER_MOTORS; i++)
223
+ // {
224
+ // Serial.print("Motor Number: ");
225
+ // Serial.print(i);
226
+ // Serial.print(" - Direction: ");
227
+ // Serial.print(motor_commands[i][0]);
228
+ // Serial.print(" - Rotations: ");
229
+ // Serial.println(motor_commands[i][1]);
230
+ // }
230
231
}
231
232
232
233
// ////////////////////////////////////////////////////////////////////////////
0 commit comments