Let's make a simple electronic organ, and play the classical song A Valediction.
Suitable kit: mCookie302, IBC
- USB cable*1
- Sensor cable*4
- Sensor shell*1
- Lego or other fixation structure
- Assemble the modules and sensors:
- Stick the red core module, battery base, and green extension module together;
- Connect the 3 touch sensors to pin 2/3, 4/5, and 6/7 of Hub respectively;
- Connect the buzzer to pin 8/9 of Hub;
- Insert one end of USB cable into the battery base, and connect the other to computer;
Required Program Blocks
Judge which touch sensor has been pressed, and the buzzer repeats executing playing the corresponding note; if no touch button is pressed, turn the buzzer off.
Start to Program
Touch button 2 is pressed, then it will play low 7.
Use the repeat doing program block, and set the condition to when touch button 2 is pressed, repeat executing playing "low 7 XI" note.
Touch button 4 is pressed, then play middle 1.
Use the repeat doing program block, and set the condition to when touch button 4 is pressed, repeat executing playing "middle 1 DO" note.
When touch button 6 is pressed, play middle 2.
Use the repeat doing program block, and set the condition to when touch button 6 is pressed, repeat executing playing "middle 2 RE" note.
When there is no sensor pressed, the buzzer is off.
1.There are 3 students in one group.
2.The song A Valediction crosses nine notes totally. Three pupils play together, each taking charge of three during them.
3.Students in the other groups evaluate the performance of which group is the best.
4.Pay attention to the length of each note and the rhythm.
Test the result
After upload, everyone play the A Valediction together.
Set up an electronic organ mode with lego, and put 3 touch buttons and one buzzer into the mode, then the electronic organ is completed.