Outline
Let's make a Morse telegraph transmitter, with two touch buttons to control the short and long sound of the buzzer, and turn the LED on at the same time.
Suitable kits: mCookie202, mCookie302, IBC
Module Bill
Module
Other Equipment
- USB cable*1
- Sensor cable*4
- Sensor shell
- Lego or other fixation structure
Module Setup
Setup
- Assemble the modules and sensors:
- Connect the color LED to pin 6/7 of Hub;
- Connect the color LED to pin 6/7 of Hub;
- Connect the touch buttons to pin 2/3 and 4/5 of Hub;
- 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.
Programming
Required Program Blocks
Programming Thought
ColorLED prepare, if the touch button 4 is pressed, the LED emits red light and the buzzer emits short "di"; if the touch button 2 is pressed, the LED will emit red light and the buzzer will emit long "di".
Start to Program
ColorLED prepare, press touch button 4, and send "short" Morse code.
ColorLED prepare: connect one LED to pin 6. If the touch button 4 is pressed, the internal program will be executed. The color LED and buzzer are activated at the same time for 0.1s. And then the color LED and buzzer go off at the same time for 0.1s. Wait for the touch button 4 to be released.
Press the touch button 2, ans send "long" Morse code.
If the touch button 2 is pressed, the internal program will be executed. The LED and the buzzer will be activated at the same time for 0.3s. Then the LED and the buzzer will go off at the same time for 0.1s. Wait for the touch button 2 to be released.
Test the result
After upload, press the touch button 4, and send short Morse code, then press the touch button 2, send long Morse code.
Send a paragraph according to the following Morse code and the English code table, and check whether other people can encode it.
Technical Specification
Related Cases
FAQ
|