mBot does not execute uploaded program


#1

Duplicated the sample app here: http://learn.makeblock.cc/wp-content/uploads/2015/05/1-line.png

Uploaded to mbot using the serial cable.

Nothing happens.

mBlock 3.3.2
updated firmware

The c code looks suspiciously thin:

#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

#include <MeMCore.h>

double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;

void setup(){
}

void loop(){
    _loop();
}
void _delay(float seconds){
    long endTime = millis() + seconds * 1000;
    while(millis() < endTime)_loop();
}

void _loop(){
}

Is the mBlock programming supposed to with the mBot, or do I need to do the programming only in c?


#2

Did you get boot your mBot after upgrade the firmware from the 3.3.2 release? because i am trying to update the firmware from the 3.3.2 version of mBlock and all i get when the board boots is a beep not the classical tones and no RGB leds flashing with colors.

How do you got upgrade your firmaware?

Thank in advance


#3

I chose the menu item “Upgrade firmware”. There was no indication of the current version, the new version, or indeed if anything was done at all.

In any case, I can run programs via the 2.4 Ghz connection, although the connection seems flaky. Sometimes the program uploads and other times it doesn’t. There’s no confirmation either way so it’s a bit of a guessing game.

My impression so far is the software is not mature and many things will be broken and not work as expected. Proceed accordingly.


#4

Hi Ophitoxaemia,

The mBot doesn’t execute any uploaded programs or only doesn’t execute the program you pasted?

Will it work when upload simple program like below?

Have you moved the bluetooth module while upload program to mBot?

The mBlock provide graphical programming for mBot, you do not need to program it in C when program using mBlock.


#5

When I enter the Scratch code you posted, I get the following C code generated by mBlock:

`#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

#include <MeMCore.h>

double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;
double speed;
double temp;
MeLineFollower linefollower_2(2);
MBotDCMotor motor(0);

void setup(){
    speed = 200;
}

void loop(){
    temp = linefollower_2.readSensors();
    if(((temp)==(0))){
        motor.move(1,speed);
    }else{
        if(((temp)==(1))){
            motor.move(3,speed);
        }else{
            if(((temp)==(2))){
                motor.move(4,speed);
            }else{
                motor.move(2,speed);
            }
        }
    }
}

Not sure why you are not getting any code generated…


#6

Try the simple program suggested. Before uploading, turn the board off, disconnect the bluetooth module, then upload. Not sure why but the BT needs to be disconnected. Perhaps a conflict.


#7

I was able to upload that simple program successfully. I did not remove the 2.4Gz card.

However, it took about 10 tries before it would connect via the serial port. I also have to guess at which COM it’s connected to, and even then it seems to do nothing most tries.

Subsequent attempts seem to connect more easily.

Thanks for the help to get this working. I’ll see if I can reproduce the original problem as well.


#8

If you use Windows, open the Control Panel>Device manager>ports. See what port the Orion is using. That’s the one to try first. BT has 2 ports, one for RX and the other for TX. I think you want the receiving port, but at least you narrow to 2!


#9