|
| 1 | +// attach the pins to the finger instances |
1 | 2 | void pinAssignment(void) |
2 | 3 | { |
3 | 4 | if(handFlag == RIGHT) |
4 | 5 | { |
5 | | - #if defined(ADULT_BOARD) |
6 | | - finger[0].attach(8,9,A4); |
7 | | - finger[1].attach(7,6,A3); |
8 | | - finger[2].attach(5,12,A2); |
9 | | - finger[3].attach(2,10,A1); |
10 | | - finger[4].attach(4,3,A0); |
11 | | - #elif defined(FOUR_MOTOR_BOARD) |
12 | | - finger[0].attach(2,10,A1,1); |
13 | | - finger[1].attach(7,6,A3); |
14 | | - finger[2].attach(5,12,A2); |
15 | | - finger[3].attach(4,3,A0); |
16 | | - #elif defined(CHILD_BOARD) |
17 | | - finger[0].attach(2,10,A1,1); |
18 | | - finger[1].attach(8,9,A4); |
19 | | - finger[2].attach(4,3,A0); |
20 | | - #elif defined(ALMOND_BOARD) |
21 | | - finger[0].attach(13,4,A5); // Right motor connector |
| 6 | + #if defined(ALMOND_BOARD) |
| 7 | + finger[0].attach(13,4,A5); // Right motor connector |
22 | 8 | finger[1].attach(3,6,A1); |
23 | 9 | finger[2].attach(7,8,A2); |
24 | 10 | finger[3].attach(10,9,A3); |
25 | 11 | finger[4].attach(11,12,A4); |
| 12 | + #elif defined(CHESTNUT_BOARD) |
| 13 | + finger[0].attach(5, 12, A2, A5, false); // attach the thumb |
| 14 | + finger[1].attach(4, 3, A0, A6, true); // attach the index (finger is inverted) |
| 15 | + finger[2].attach(10, 11, A1, A7, true); // attach the middle (finger is inverted) |
| 16 | + finger[3].attach(9, 6, A3, A8, true); // attach the ring & pinky (finger is inverted) |
26 | 17 | #else |
27 | 18 | #error 'No board selected' |
28 | 19 | #endif |
29 | 20 | } |
30 | 21 | else if(handFlag == LEFT) |
31 | 22 | { |
32 | | - #if defined(ADULT_BOARD) |
33 | | - finger[0].attach(8,9,A4); |
34 | | - finger[4].attach(4,3,A0); |
35 | | - finger[3].attach(2,10,A1); |
36 | | - finger[2].attach(5,12,A2); |
37 | | - finger[1].attach(7,6,A3); |
38 | | - #elif defined(FOUR_MOTOR_BOARD) |
39 | | - finger[0].attach(5,12,A2,1); |
40 | | - finger[1].attach(4,3,A0); |
41 | | - finger[2].attach(2,10,A1); |
42 | | - finger[3].attach(7,6,A3); |
43 | | - #elif defined(CHILD_BOARD) |
44 | | - finger[0].attach(2,10,A1,1); |
45 | | - finger[1].attach(4,3,A0); |
46 | | - finger[2].attach(8,9,A4); |
47 | | - #elif defined(ALMOND_BOARD) |
48 | | - finger[0].attach(5,2,A0); // Left motor connector |
| 23 | + #if defined(ALMOND_BOARD) |
| 24 | + finger[0].attach(5,2,A0); // Left motor connector |
49 | 25 | finger[1].attach(11,12,A4); |
50 | 26 | finger[2].attach(10,9,A3); |
51 | 27 | finger[3].attach(7,8,A2); |
52 | 28 | finger[4].attach(3,6,A1); |
| 29 | + #elif defined(CHESTNUT_BOARD) |
| 30 | + finger[0].attach(9, 6, A3, A8, true); // attach the thumb |
| 31 | + finger[1].attach(10, 11, A1, A7, true); // attach the index (finger is inverted) |
| 32 | + finger[2].attach(4, 3, A0, A6, true); // attach the middle (finger is inverted) |
| 33 | + finger[3].attach(5, 12, A2, A5, false); // attach the ring & pinky (finger is inverted) |
53 | 34 | #else |
54 | 35 | #error 'No board selected' |
55 | 36 | #endif |
56 | 37 | } |
57 | 38 | } |
| 39 | + |
0 commit comments