diff options
Diffstat (limited to 'Venus_Skeleton/Venus_Skeleton.ino')
-rw-r--r-- | Venus_Skeleton/Venus_Skeleton.ino | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Venus_Skeleton/Venus_Skeleton.ino b/Venus_Skeleton/Venus_Skeleton.ino index 6683a4b..0b366fc 100644 --- a/Venus_Skeleton/Venus_Skeleton.ino +++ b/Venus_Skeleton/Venus_Skeleton.ino @@ -185,13 +185,13 @@ long microsecondsToCentimeters(long microseconds) void initTurretSequence(int array[], int numOfPositions) { // for n=7, fill lower half of array with 0, 2, 4, 6 // for n=8, fill lower half of array with 0, 2, 4, 6 - for (int i = 0; i < numOfPositions / 2; i++) { + for (int i = 0; i < (numOfPositions + 1) / 2; i++) { array[i] = i * 2; } // for n=7, fill upper half of array with 5, 3, 1 // for n=8, fill upper half of array with 7, 5, 3, 1 int x = numOfPositions / 2 * 2 - 1; - for (int i = numOfPositions / 2 + 1; i < numOfPositions; i++) { + for (int i = (numOfPositions + 1) / 2; i < numOfPositions; i++) { array[i] = x; x -= 2; } |