Mbot lose code memory uploaded last nite (new to mblock)


#1

Hi all, sorry Im new to mblock, question should be silly

  1. Last nite I tried to make simple program and upload to mbot (i used ‘when green flag is clicked’ and ‘turn on led light’ and upload to mbot) , I switch off the mbot and on again, the mbot light is on, fine, but I turn on mbot today, the led can’t turn on, why?

  2. what’s the next step? the program should work with remote control right? that means I have to program when which button is pressed, it will function what purpose


#2

Hi @shanemcmahon,

When you use the When Green Flag is Clicked, you are running the program from within the mBlock environment. It is executing the program by sending the commands over the air if you are connected via WiFi or Bluetooth. If you want to upload the program to the mBot, you will need to use the mBot Program block instead of the When Green Flag is Clicked block to start the program. If you want a program that will work with the remote control, you will need to write one. Be aware that to upload a program to the mBot requires that you connect the mBot with the USB cable. You cannot upload programs over the air.

I wrote a short eBook that discusses programming the mBot with Scratch (mBlock) that can be purchased here. It’s relatively inexpensive but it covers the use of most of the devices on the mBot starting with turning LEDs on and off and ending with a maze solving robot. (For what it’s worth, the proceeds from the book sales go into a fund for kids robotics)

As a general rule, it is a good idea to upgrade the firmware if the mBot is acting up. That will flush out the memory in case something has corrupted it. Resetting the default program will restore the mBot to factory condition. Both of these programs are under the Connect menu item in mBlock.


#3

Thanks for the answer and I will considering to order the book

BTW, I have another problem, I found that after I used mblock I cannot control the mbotusing IR remote control (actually I haven’t tried the remote before), how can I make it work again? Do I need to register my remote with my mbot? (I’ve two remote I am not sure which remote is for which mbot), thanks


#4

You can reset the default program by connecting the USB cable and clicking that option on the Connect menu. I’ve found that often I need to do a restore of the firmware to clear out anything that might be causing the mBot to act up and then load my program. Could you post a screen shot of your code? I did a sample application in the book that demonstrates how to use the IR remote with the mBot.


#5

The problem is, after I programmed some simple coding (say just moving the motor), when connected to mblock, the motor keeps moving. I click to reset to default program, it have no response (no upload popup) , however, sometimes I’m lucky that it can be success, but most of the time not, why?


#6

The motor will keep moving unless you specifically tell it to stop by setting the speed to zero. Does the title bar say that you are connected (via the USB cable) when you attempt to reset the default program?

My reset sequence is:

  1. Connect the mBot to the computer with the USB cable
  2. Click the Connect menu item in mBlock to connect the mBot to mBlock.
  3. Upgrade the firmware (Connect->Upgrade Firmware)
  4. Reset the default program (Connect->Reset Default Program)

That has always worked for me so I’m curious as to what is happening on your end.


#7

Yes i just test simple program thus the motor may not be stopped

Yes its connected

–> Do I need to upgrade firmware everytime when I reset to default program? Sometimes I just click reset , it have no response then I click upgrade, reset, then no response.

I tried again now with the sequence and worked this time. I just think that upgrade firmware is to upgrade the mbot’s firmware which I don’t need to always do so?


#8

Upgrading the firmware will ensure that any memory corruption that may have occurred will be repaired.