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

Commit 1d654b8

Browse files
Added 9 motor mappings and test strings
1 parent 7ac6190 commit 1d654b8

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed
0 Bytes
Binary file not shown.

arduino_controller/TestStrings.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Up,5,Up,5>
2+
<Down,5,Down,5>
3+
<Up,5,Up,5,Up,5>
4+
<Down,5,Down,5,Down,5>
5+
<Up,5,Up,5,Up,5,Up,5>
6+
<Down,5,Down,5,Down,5,Down,5>
7+
<Up,5,Up,5,Up,5,Up,5,Up,5>
8+
<Down,5,Down,5,Down,5,Down,5,Down,5>
9+
<Up,5,Up,5,Up,5,Up,5,Up,5,Up,5>
10+
<Down,5,Down,5,Down,5,Down,5,Down,5,Down,5>
11+
<Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5>
12+
<Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5>
13+
<Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5>
14+
<Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5>
15+
<Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5,Up,5>
16+
<Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5,Down,5>

arduino_controller/arduino_controller.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#include <String.h>
33

44
// constants
5-
#define DEBOUNCE_TIME .5
5+
#define DEBOUNCE_TIME .4
66
#define SAMPLE_FREQUENCY 20
77
#define MAXIMUM (DEBOUNCE_TIME * SAMPLE_FREQUENCY)
8-
#define NUMBER_MOTORS 2
9-
// #define NUMBER_MOTORS 3
8+
#define NUMBER_MOTORS 9
109

1110
// function declarations
1211
void RecvWithStartEndMarkers();
@@ -15,15 +14,14 @@ int CheckSwitch();
1514
void PopulateArray();
1615

1716
// variables for communication
18-
const byte num_chars = 32;
17+
const byte num_chars = 100;
1918
char received_chars[num_chars];
2019
bool new_data = false;
2120

2221
// initialize motors
2322
Servo my_servo[NUMBER_MOTORS];
2423
// create a array of ports with the order: motor, counter, reset
25-
int ports[NUMBER_MOTORS][3] = {{2, 3, 4}, {5, 6, 7}};
26-
// int ports[NUMBER_MOTORS][3] = {{2, 3, 4}, {5, 6, 7},{8, 9, 10}};
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}};
2725

2826
// integer array that contains the direction and number of rotations a motor
2927
// needs to go

0 commit comments

Comments
 (0)