Case 11 - Voice-Activated RGB LED Indicator
Part 1 Objective
Use sound to control the lighting of the RGB LED indicator on Codey's screen. When the sound is loud, the RGB LED indicator lights up and Codey's screen displays the sound loudness. When the sound is low, the RGB LED indicator goes off.
Part 2 Preparation
Codey (robot controller) x 1
USB cable x 1
Computer with network access x 1
Connect Codey to the computer by using the USB cable, open mBlock 5 (PC client, web version, or mobile app), delete the default device, click +add, select Codey from Device Library and then click Set as mostly used device in the upper left corner, click Connect, and select the Upload mode.
Part 3 Programming
Use the loudness block in Sensing blocks together with Looks blocks, Lighting blocks and so on, and click Upload to make Codey's screen display the sound loudness and the RGB LED indicator light up when the ambient sound is loud.
Part 4 Practice
Try to give the RGB LED indicator different colors for different sound loudness and make Codey's screen display the RGB LED indicator with different colors when different sound loudness is detected.