b'Circuit 2C: SimonThe Simon Says game uses LEDs to flash a330pattern, which the player must remember100kSays Game and repeat using four buttons. This simple electronic game has been a classic since the late 1970s. Now you can build your own!POTENTIOMETERPIEZO BUZZER16 JUMPER WIRES4 PUSH BUTTONS YOU4 LEDSNEED4 330 RESISTORSNEW CONCEPTS brackets, which prints the value of i to the Serial Monitor.FOR LOOPS: A for loop repeats a section of code a set number of times. TheMEASURING DURATIONS OF TIME loop works by using a counter (usuallyWITH MILLIS(): The RedBoard has a programmers use the letter i for thisbuilt-in clock that keeps accurate time. variable) that increases each loop until itYou can use the millis() command to reaches a stop value. Heres an example ofsee how many milliseconds have passed a simple for loop: since the RedBoard was last powered. By for (int i = 0; i < 5; i){storing the time when an event happens Serial.print(i);and then subtracting the current time, you } can measure the number of milliseconds The for loop takes three parameters in(and thus seconds) that have passed. This the brackets, separated by semicolons. Thesketch uses this function to set a time limit first parameter is the start value. In thisfor repeating the pattern.case, integer i starts at 0. The second valueCUSTOM FUNCTIONS: This sketch is the stop condition. In this case, we stop the loop when i is no longer less than 5 (iuses several user-defined functions. These < 5 is no longer true). The final parameterfunctions perform operations that are is an increment value. i is shorthandneeded many times in the program (for for increase i by 1 each time, but you couldexample, reading which button is currently also increase i by different amounts. Thispressed or turning all of the LEDs off). loop would repeat five times. Each timeFunctions are essential to make more it would run the code in between thecomplex programs readable and compact.47 : circuit 2c'