Mbot in arduino ide


#1

hello,
I am trying to upload a code from arduino IDE to my mbot robot using board arduino Leonardo also i trid the genuino but still I have an error
(An error occurred while uploading the sketch) and suggestion to solve it.


#2

@m.alm,

Show us your code, so we can test it to see what is happening.

Thanks,

Mike


#3
//#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include <MeMCore.h>

SoftwareSerial myserial(0,1);
MeDCMotor motor_9(9);
MeDCMotor motor_10(10);
void move(int direction, int speed)
{
      int leftSpeed = 0;
      int rightSpeed = 0;
      if(direction == 1){
          leftSpeed = speed;
          rightSpeed = speed;
      }else if(direction == 2){
          leftSpeed = -speed;
          rightSpeed = -speed;
      }else if(direction == 3){
          leftSpeed = -speed;
          rightSpeed = speed;
      }else if(direction == 4){
          leftSpeed = speed;
          rightSpeed = -speed;
      }
      motor_9.run((9)==M1?-(leftSpeed):(leftSpeed));
      motor_10.run((10)==M1?-(rightSpeed):(rightSpeed));
}
double angle_rad = PI/180.0;
double angle_deg = 180.0/PI;
char  dataFromESP;

void setup(){
  //serial.begin(4800);
   myserial.begin(4800);
    dataFromESP = myserial.read();
    if(((dataFromESP)==(1))){
        move(1,100);
    }
}

void loop(){
    _loop();
}

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

void _loop(){
}

this is the test code in arduino ide for mbot
it should perform serial communication with other arduino


#4

BN: Unknown board
VID: 1A86
PID: 7523
SN: Upload any sketch to obtain it

i think this information appear when i connect to the arduino idea


#5

You are supposed to use Arduino UNO (it worked for me).


#6

how to install it on the board list because I am not able to see it in the board list


#7

What Arduino IDE are you using?

I have both 1.6 and 1.8, try to install the last version.


#8

yes I have this board I use it but still have the error but I have seen that there is a Arduino Uno board only this what may be working but I do not have it.
Ok I understand it is a uno ??!
So what do you think the problem is it form !
becasue when I tried to upload from the makeblock a simple program it work very fine but in the arduino idea i still have an error


#9

Not sure, try posting pics of your board selection and the error from the IDE.

Regards

Javi


#10

General things to try:

  1. If you are using Mac OS, you will need to install a driver. The specific driver will depend on the version of Mac OS you are running.
  2. Make sure you have selected the correct serial port.
  3. Make sure the mBot is turned on.
  4. Try a different USB cable to see if that is causing the problem

Regards,

Chuck


#11

attached is the error message
Arduino: 1.6.12 (Windows 10), Board: “Arduino/Genuino Uno”

Sketch uses 5,016 bytes (15%) of program storage space. Maximum is 32,256 bytes.
Global variables use 902 bytes (44%) of dynamic memory, leaving 1,146 bytes for local variables. Maximum is 2,048 bytes.
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


#12

Did you check in “My computer” if usb device is properly detected?


#13

I suppose yes


#14

As I gave up on Windows I cannot help any more… If you have a Linux partition or virtual image you can try giving permissions to ports (or adding usb permissions to user).

I hope there is some Windows users around here that may help.

Javi


#15

When you upload a program from Makeblock in Arduino more, it should give you some information about com port, baud rate and so on in the terminal window. Could you try to use the same settings in Arduino IDE?
Also close Makeblock before using Arduino IDE


#16