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.
Mbot in arduino ide
//#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
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
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
Not sure, try posting pics of your board selection and the error from the IDE.
Regards
Javi
General things to try:
- 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.
- Make sure you have selected the correct serial port.
- Make sure the mBot is turned on.
- Try a different USB cable to see if that is causing the problem
Regards,
Chuck
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.
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
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