Start Create
Download

Codecraft Online

More >

What kits can I find these modules in?

the All-in-on Kit,

the Explorer Kit

G0&Fittings List

    Here you can find out the target blocks in the block menu.

Start the graphical programming

    This above block in “Events” has three drop-down lists for adjusting parameters of the Twin Button.
 

    In the list on the very left, when there are more than one Twin Button connected, you can determine which of them to receive the 

   

    order (More info: https://docproxy.chmakered.com/web/#/2?page_id=115). For the take-copter gear, we only use one Twin Button.  

   

    Therefore, the parameter here remains 1.
 

    In the list on the middle, you can determine which button to receive the order (button A, B or A+B). 
 

    In the list on the very right, you can determine how to press the button (clicked” or “held”).

 

 

    Here we need two blocks to send the orders, one for button A, another for button B.
 

1. Go to Cocraft (https://ide.chmakered.com/).

   

    Create a new project.

2. Find out the twin button block in “Events” which works as an input module in the take-copter gear.

Times

Every now and then we still fancy ourselves soaring in the air one day, wearingDoraemon’s take-copter gear. Today, just let me show you how to make a take-copterwith G0 modules, which can take off and land by a twin button switch, meanwhiledecorated with a colorful lighting.

Take-copter

20 minutes

Level

Back to Home >

DC motor

×2

Twin Button

×1

RGB LED

×1

Battery

×1

Main Board BLE

×1

Other Materials

4. Except for the motor, I need another output module, the RGB LED.When the motor rotates, the colorful lamp will spin like a rainbow.

   

    When the motor stops, the lamp will stop spinning. Find out the below blocks in Looks.


 

Please follow the video below.

Assembling

6. Connect the adjustable lamp, the motor and the Main Board BLE together via magnet suction.

 

    Connect the Main Board BLE to computer with a USB cable, connect Cocraft to the Main Board BLE.   

    ↓

 

    Tutorial: https://docproxy.chmakered.com/web/#/2?page_id=173

    ↓

 

    Open Online Debug Mode (Tutorial: https://docproxy.chmakered.com/web/#/2?page_id=172)

    ↓

 

    Click the block group of button A with the mouse (Which means the analog button A is pressed) to check whether the motor will rotate

   

    with a rainbow lightening effect; Click the block group of button B with the mouse (Which means the analog button B is pressed) to

 

    check whether the motor will stop with a red lightening.

 

    (If the program doesn’t run, please check and see whether you follow the procedures carefully.)

5. Name the codes on the upper box of the interface and click Save.


 

    Place them under the block groups above. We have finished editing of the blocks by far.


 

3. In this step, we need to edit the blocks as “When 1 twin button A clicked, M1 DC Motor rotate at power 50%”, and, “When 1 twin

 

    button B clicked, M1 DC Motor stop”.
   

    Firstly, find out the two blocks that control on and off of the motor in Motion.
 

 

    As we know, each single block can only control one port. Here in our lesson, we select M1 as the target port. We can see the motor

   

    board has two ports respectively called M1 and M2. Therefore, we should connect the motor to the board via the M1 port.
 


 

    Place the two motor blocks underneath the button blocks respectively. Blocks will automatically lean together as they get close to

   

    each other. board has two ports respectively called M1 and M2. Therefore, we should connect the motor to the board via the M1 port.