mBot2 Cyberpi missing "When key is released"


Hey there !

I’m using mBots V1 with my students for a while now.
Recently i moved to mBots 2 with the cyberpi module.

Before, on mBlock 5 i was able to add the mBlock 3 extension to add the “when key is released” block but with the cyberpi and the mBot chassis extension, it’s not possible…
I want them to discover the bot by controling it with the keyboard while connected and the bot not stoping upon releasing key is not a solution with student driving the bot on their tables…

Any ideas on what i could do ? I saw some methods here but many of them lag and some are not suitable for young students to master…

In advance thanks !


Would this code work?
It is fairly simple (three blocks, plus your code) and not at all laggy.


Hey there,

Thanks for your reply !

This code works well with the onboard buttons but as i’m trying to make them remote control the bot with the keyboard i’m not sure i’ll be able to use the same method !

Thanks anyway and i’m going to check if i can modify my activity to pilot the bot with the onboard joystick !



No problem!
Another solution:
Go to the “Sprite” tab:
Add the extension:
Broadcast “message” when the space key is released:
Go back to the device tab:
Run your code when the device receives the message:

This method has no lag and is fairly simple (four blocks). Hope it helps!


You’re a real Hero !

Many thanks !

I’ll try that asap !



Thanks a lot! I’m glad I could help.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.