Scratch vs mbot program method


#1

Connect the mbot to 2.4ghz port in the after mblock did not run correctly when you run just a line follower source. (Continued backing should . ) But using a usb cable has the correct behavior when you upload to the Arduino way. Tell us why this difference that occurs


#2

Here’s my best guess based on my experiments:

Clicking on a program in the “Scratch interface” opens serial communication to the mBot and starts to execute. This is a bidirectional serial interface, so data can be sent back into the Scratch environment from the mBot. But it’s also real-time - no instructions are stored on the mBot. If you close mBlock (or it crashes) the mBot will recieve no further instructions. Instructions with a timed parameter will eventually turn off, but anything that’s set to run indefinatey or until some condition is met will just continue.

If you connect via USB and use the “Upload to Arduino” command, the instructions will be written to the Arduino’s program memory. This means that it will execute independantly. Yu can remove the USB cable and the program will stuff function. You can turn the mBot off, restart it and the last program will execute.

To the best of my knowledge, you CAN NOT upload a program to the mBot in the traditional Arduiono sense using the 2.4g Serial adapter. Wireless serial allows for ONLY the real-time, interactive control over the mBot.

Similarly, I don’t think the uploaded programs can communicate back to the Scratch-like environment of mBlock. I’d like to be wrong about this!

Does this match what you’ve seen with mBot?


Can't reprogram remote control
#3