Uploading in Arduino mode does not allow for parallel activites


#1

When using MBlock 3 I am trying to upload a program that makes the MBot sing and dance. So there are 2 different MBot events. It will not play them together. It dances and then sings.


#2

Precisely so. The mBot mCore boards is based on the Atmel AT328P (same board as the Arduino Uno) and cannot multitask. However, you can time-slice and accomplish much of the same thing. Doing this in mBlock is a bit cumbersome because you have to keep track of separate timers for the items (singing, dancing) and check them every time the forever loop runs. I’m doing something similar with an Arduino class I wrote called ActionTimer (link) and a MusicBox (link) that time-slices the notes for the melody. You can do something similar by setting up custom blocks in mBlock.