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.

Next Transition Functions

  1. Change your previous void function parseStringForNextColor to be now titled parseTableForNextEntry.
    1. In your first for loop, modify what rgbNext[color] is set to, to point to the table and the array rgb[color].
    2. Delete your call to echoRgbInput.
    3. We need to add another for loop, taking in the byte disk, from front to back, increasing each time.
      1. Set the discVelocityPrev array to the next disk velocity array.
      2. Here, we use the same type of idea as #2, and set discVelocityNext[disk] to point to the table and the discVelocities array.
    4. The last two things we need to do is set the trasitionDuration and the nextTransitionTime.
      1. transitionDuration is set to look at the table, and itself.
      2. nextTransitionTime is set to look at the table, and the sum of delayDuration and transitionDuration.
  2. There are two functions we no longer need in here, and they are checkIfDataIsIncoming and echoRgbInput. They can be deleted.
  3. Next, we will modify our calculateSlope function.
    1. Add a second for loop, the same as the second one in parseTableForNextEntry.
    2. Inside of the for loop, we have to do some math. Set the array diskVelocitySlope to the difference of discVelocityNext and discVelocityPrev, all divided by transitionDuration.
  4. We have one last function, titled updateIndex.
    1. In the first line, we increase index by one incrementally.
    2. Finally, create an if statement, stating if index is greater than or equal to ExtravaganzaLength, set index to zero.

You're done with your code, you should have everything now! If you have a wording question, or notice any errors, talk to Anna the senior.

Check for Understanding



Back