// // (Worksheet 4.6.1s - Color Wheel Startup Tests. ) // Copy the following code into your active project file // The first chunk of code (numbers 3 and 4) goes just BEFORE your void setup()definition. // The rest goes INSIDE your void setup() definition at the end of your initialization code. // // // (Worksheet 4.6.1s Number 3) // Create a function called clearRowPins() which uses a for() loop to turn OFF all eight of the LED row pins // Use the functions you've already created to set and clear individual row pins void clearRowPins(void) { for (int i=0; i<8; i++){ } } // (Worksheet 4.6.1s Number 4) // Create another function called setRowPins() which uses a for() loop to turn ON all eight of the LED row pins // It will look very similar to the clearRowPins function. // // The rest of this code should go inside your setup() function after the initialization code // It will replace code that you may already have to turn individual lights on and off. // // (Worksheet 4.6.1s Number 5) // In the setup() function after all the initialization code create a for loop that turns on each color // (red, green and blue or 0, 1, 2) in turn and then waits 1 second ( delay(1000); ) // Before the for loop call setRowPins(); after it call clearRowPins(). // setRowPins(); for (int color = 0; color <3; color++ ) { } // (Worksheet 4.6.1s Number 8) // Create a set of three nested for loops. // The outermost loop should cycle through each of the eight row pins in turn, // turning on that row at the beginning, and turning it off at the end. // The next inner loop (between the on and off commands) should count to 128. // The inner most loop should cycle between the three colors setting each and then // waiting for a short time (1 or 2 mSec) for (int row=0; row<8; row++) { setRowPin(row); for (int i=0; i<128; i++) { for ( ; ; ) { } } // what goes here? }