diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-06-17 16:46:03 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-06-17 16:46:33 +0200 |
commit | f5781e50ee0a371b6198967a82630aabfd493d32 (patch) | |
tree | 0f0ed1fa967714cd53650b021ad266d98f7721af /Venus_Skeleton/Venus_Skeleton.ino | |
parent | 7b9502e3f41dc2d3f42a85ce65205080227efe12 (diff) | |
download | code-f5781e50ee0a371b6198967a82630aabfd493d32.tar.gz |
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; } |