Page 1 of 1

Wukong board - Turn motor on for 2 seconds

Posted: Sun Jan 02, 2022 5:46 pm
by vmcduarte
Hello

I am using the Microbit blocks programing.

I want to make a simple code for my kid:

Button A: Set Motors M1 & M2 to turn at 20% for 1 seconds

The code is bellow.

However, the motors keep turning forever and don't stop after 1 sec.

What am I doing wrong?

Thanks!


Image

Re: Wukong board - Turn motor on for 2 seconds

Posted: Sun Jan 02, 2022 7:12 pm
by lujo
Hi,

If you set the motor speed, the motor starts running.
To stop the motor(s) use the Stop motor or Stop all motor blocks.

Maybe you should do this in MicroPython. The typescript source is at
https://github.com/elecfreaks/pxt-wukon ... er/main.ts.
Should be very easy to translate to MicroPython. Could use the
mu-editor the write the code and flash it to the micro:bit.

lujo

Re: Wukong board - Turn motor on for 2 seconds

Posted: Mon Jan 03, 2022 3:55 pm
by vmcduarte
Thanks!