Problems programming in scratch mode


#1

Hi everybady
I own an Mbot and didn’t have any problem until toady. I can’t anymore communicate with the robot in scratch mode (I mean when the bot is connected with the USB cable). I can still upload the program in Arduino mode.
Another problem is with the motors. For example, if I want the bot going forward at speed 50, even if the uploading is working (in Arduino mode) the wheel are not turning and the motors are producing something like a whistle.
I have no problem in communicating with the APP, the motors are perfectly working.
I hope someone can help me
thenks
Teomat


#2

Hi,

It’s always helpful to mention the following items to help with troubleshooting:

  1. Operating System
  2. Version of mBlock
  3. Screenshot of your program (or attach the program to the message)

mBot Motors will not usually turn at a speed of 50. The motors are controlled using pulse-width modulation (PWM) and unfortunately at a “speed” of 50 there is not enough current to overcome the resistance of the motor and make it turn. My experience is that a “speed” of 75 is about the lower end of what will make the mBot move.

With regard to communicating with the mBot, could you provide more details of what you are trying to do? If you can upload a program to the mBot, then you are communicating with it.

Regards,

Chuck


#3

Thanks a lot Chuck e sorry for the missing information.
My Operating System is Sierra 10.13.6, mBlock version is 3.4.11
I solved the problem with the motors, you actually were wright, 50 of “speed” it’s not enough to make turn the motors, I tried with 100 and is ok.
I didn’t solved yet the other problem. I can’t communicate with the mBot in scratch mode. The simple sketch in the picture is not working. The mBot is connected with the USB cable, the serial port connected too, but pressing the space bar nothing happens
matteo

ScratchMode


#4

Hi @Teomat,

I did the following:

  1. Upgrade firmware
  2. Reset default program

I set up your code after this sequence and it appeared to work as expected. My experience has taught me to do the upgrade firmware/reset default program when weird things start happening. For what it’s worth, if you are doing any Arduino programming on the mBot or the other robots, then you need to at least upgrade the firmware and possibly reset the default program before mBlock programs will work with the mBot.

Hope this helps. :slight_smile:

Chuck


#5

Hi @chuckmcknight
thank for suggestions, id did what you told me to do, unfortunately it didn’t solve the problem. It’s actually hard to understand what’s happening. Has you can see in the picture the green flag on the top is active and light under the “code lines” is on, the port is connected but the wheels are not turning.


Matteo


#6

Hmm, strange. After I did the full reset of the firmware and default program, I ran the code you posted and the wheels turned.


#7

Hi Teomat,
Did you upgrade firmware before running online program as you mentioned?
Since to run an online program, we have to use upgrading program. So the order should be: reset default program, then upgrade firmware.
For offline program (upload to the main board), is it working? Besides the motors, have you tried any other sensors like on board buzzer?


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.