Make Codey Rocky Identify Colors
Make Codey Rocky Identify Colors
1) Drag an Event block when Codey starts up to the Scripts area.
2) Add a Control block if () then (), and a Sensing block the color detected is ()?.
3) Add a Lighting block RGB LED lights up () to make the LED lights up red when the color detected is red. Drag a play sound () block and change the sound to “score” to add some sound effects.
4) We want Codey Rocky to detect color blue. Right click to duplicate the blocks. Change the color to blue.
5) Add a Control block forever to create a loop.
6) Click “Upload” to upload the program to Codey.
7) Have a try!
Note: keep the IR sensor face-down.