Kinetic Sculpture: Extravaganza

Home

Current Objective: Make the Extravanganza of your Kinetic Sculpture

Requirements

  1. Cleanly format your code to maximize organization and readability like theĀ dpeaArduinoStyleGuide.
  2. Clarify the purpose of each function and variable through smartĀ naming.
  3. Use headers and comments as needed to enhance organization.

Transitioning Functions

  1. Change your header "Fading Functions" to be titled "Transitioning Functions".
  2. The first function we need to add is updateDiscVelocities.
    1. Create a for loop, that takes in a new byte called disk that exsists from front to back, increasing each time.
    2. Inside this for loop, call the array discVelocityControl and update it with updateDiscVelocity.
  3. After the function updateElapsedTime, the next function we need is checkIfTransitioning.
    1. 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).
    2. Create an if statement, to set timeForNextTransition to true if the elapsedTime is greater than nextTransitionTime.
    3. Add an else statement setting timeForNextTransition to false.
  4. Next, we need to change the function finishTransition.
    1. After your call to setColor and before you set transitioning to false, call the function setFinalVelocities.
  5. Create a new function titled setFinalVelocities.
    1. Add a for loop exactly like the one in updateDiscVeloticies.
    2. Inside this for loop, call the array discVelocityValue and set it equal to the array discVelocityNext.
    3. Outside of the for loop (but still within the function), call the function setDiscVelocities.
  6. Create a new function titled interpolateDiscVelocities, after interpolateColor and setColor.
    1. Add a for loop exactly like the one in updateDiscVeloticies and setFinalVelocities.
    2. Inside this for loop, call the array discVelocityValue and set it equal to the array discVelocitySlope times elapsedTime plus the array discVelocityPrev
  7. Create a new function titled setDiscVelocities.
    1. Add that same for loop again, like the one in updateDiscVeloticies and setFinalVelocities.
    2. 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.

Back

Next Page