Current Objective: Make the Extravanganza of your Kinetic Sculpture
Requirements
- Cleanly format your code to maximize organization and readability like theĀ dpeaArduinoStyleGuide.
- Clarify the purpose of each function and variable through smartĀ naming.
- Use headers and comments as needed to enhance organization.
Transitioning Functions
- Change your header "Fading Functions" to be titled "Transitioning Functions".
- The first function we need to add is updateDiscVelocities.
- Create a for loop, that takes in a new byte called disk that exsists from front to back, increasing each time.
- Inside this for loop, call the array discVelocityControl and update it with updateDiscVelocity.
- After the function updateElapsedTime, the next function we need is checkIfTransitioning.
- Change the else if statement after the if loop to state that if it is transitioning, it will finish the transition (hint: use your finishTransition function).
- Create an if statement, to set timeForNextTransition to true if the elapsedTime is greater than nextTransitionTime.
- Add an else statement setting timeForNextTransition to false.
- Next, we need to change the function finishTransition.
- After your call to setColor and before you set transitioning to false, call the function setFinalVelocities.
- Create a new function titled setFinalVelocities.
- Add a for loop exactly like the one in updateDiscVeloticies.
- Inside this for loop, call the array discVelocityValue and set it equal to the array discVelocityNext.
- Outside of the for loop (but still within the function), call the function setDiscVelocities.
- Create a new function titled interpolateDiscVelocities, after interpolateColor and setColor.
- Add a for loop exactly like the one in updateDiscVeloticies and setFinalVelocities.
- Inside this for loop, call the array discVelocityValue and set it equal to the array discVelocitySlope times elapsedTime plus the array discVelocityPrev
- Create a new function titled setDiscVelocities.
- Add that same for loop again, like the one in updateDiscVeloticies and setFinalVelocities.
- Inside this for loop, call the array discVelocityControl and update it with the funciton setDiscVelocity which takes in the array discVelocityValue.
One more page after this! If you have a wording question, or notice any errors, talk to Anna the senior.
BackNext Page