I just got my mBot yesterday and I am doing pretty well with it.
However, I am having trouble getting the Live mode to work from the IDE.
Here is a short program that I uploaded to the mBot.
As expected, the right led turns on red when the on-board button is pressed and turns off when the button is released.
I then switch over to Live mode and change the event handler so that it looks like this.
Notice that I changed the LED color to green.
I then click on the flag and press the on-board button and the LED is still green.
I have to believe that I am making a simple mistake but I don’t know what it is.
Any help would be appreciated.
Thanks,
Bruce
I Can't Get mBot Live Mode To Run Code
@bjones
That code should, when uploaded, make the lights be red when the button is pushed and held.
That code should, in live mode, only run after the green flag is clicked. When the onboard button is pushed and held, the lights will be green. Please try to push and hold the button for a while, as live mode can be laggy. That may be the issue. Otherwise, can you please provide your version of mBlock (5.4.0 or 5.4.3), the client type (PC app or Web), and how your mBot is connected?
Thanks!
P.S. Would you like me to remove your post
Oops,
The second screen shot is not right.
Here is the right one.
image
Sorry about that.
For you?
Here is a larger screen shot.
I am on a Windows 11 PC and I have tried connecting through two different USB ports.
I have disconnected and connected several times. When I do an upload then things work just fine. I think that this indicates that the communication through the provided USB cable is good.
I have clicked the green flag many times and have waited several minutes but the color of the LED does not change to the live color. And just to be sure, the green arrow is on the bottom right of the window with the sprite.
Again, thanks for taking interest in this.
Bruce
Try the web version at
https://ide.mblock.cc/
with mLink installed. You can also try downgrading to mBlock V5.4.0, as 5.4.3 is known to have some issues.
https://dl.makeblock.com/mblock5/win32/V5.3.0.exe
There is the download URL for the older version.
Also, let me get everything correct:
- You connect mBot
- You put mBlock in live mode
- You click the green flag
- You press and hold the onboard button on mBot for several seconds, to be safe
- Nothing happens
@bjones I hope we get this fixed!
Things got busy last night so I had to wait until this morning to try your suggestions.
I tried the web version and was a bit surprised to find that it wanted me to download and install mLink2. I thought that mLink came along with the installation of mBlock.
Regardless, I was able to upload a web based version of a program to the mBot and it worked. However, when I tried to go to live mode it did not work. I ran the web version from a Windows 11 machine and the Chrome browser.
The link that you gave me was for version 5.3.0 and I installed it and the same thing happened.
Not to be overly picky but your steps were correct all the way up to the last one. When I pressed the button the old color displayed instead of the new color.
If hope that you don’t mind me asking. Who are you and why are you willing to spend so much time with me on my little problem?
Thanks,
Bruce
I am a helper on the makeblock forum. It’s kind of what I do.
I don’t know what the issue could be at this point, so I am going to do some tests on my own mBot later.
Best Regards!
@bjones
Well, I’m glad that you are doing what you do. You have been a lot of help and I don’t feel like I’m hanging out here on my own.
Having to upload the program each time is not such a big deal. It just irks me when I can’t make something work that should work.
I also have two other devices on USB ports just in case that there might be some USB driver conflicts. They are some Koss headphones and a Logitech mouse and keyboard.
I would be more than happy to set up a Zoom call so that you can monitor my screen and watch the mBot.
Again, thanks for you help.
I am also quite sure that you will be hearing from me again in the future as I get stuck on other issues.
Bruce
I don’t do zoom. Sorry. I try to keep anonymous online, even if I am inclined to believe that you are probably trustworthy. I will do some testing with my mBot later whenever I have time. I am glad that I have been able to help. Good luck with your coding!
P.S. If you need more help, mention me as @Best_codes so I will get a message.
Understood.
With this or any other issue I would be happy to make an MP4 video of what is going on.
Bruce
I found the issue. It is a glitch in mBlock.
See:
With those codes, the mBot should continuously light up green in upload mode and light up red in live mode only if I push the button. In both modes, mBot just lights up green. This means that apparently mBot isn’t switching properly to live mode. We will just have to wait for them to fix it in this version or use an older version.
@bjones
To mBlock:
Upon reviewing your code, I believe there may be a permission’s error in your electron app (or similar, if you used that type of package). Anyway, in web and PC, access to COM12 (or other ports) is denied. This is the issue with live mode, it is using the browser API instead of routing through mLink. See below:
Let’s just hope they get it fixed. We can email them about it at
support@makeblock.com
and hopefully they will fix the bug.