About Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It’s intended for anyone making interactive projects. The Arduino development environment makes it easy to write code and upload it to the I/O board. You can use Arduino language (C\C++) to interace with Arduino hardware.
Set Arduino
Get Arduino IDE and Makeblock program library
Login Arduino's official website to download Arduino IDE:
https://www.arduino.cc/en/Main/Software
You should download the installation package for corresponding operating system (Subject to the latest version).
Install the Makeblock libraries
1. Download Makeblock library functions:
https://github.com/Makeblock-official/Makeblock-Libraries/archive/master.zip
2. Decompress the makeblock folder in the zip to the Arduino default library.Your Arduino library folder should now look like this:
- Windows 7(on Windows):
[arduino installation directory]\libraries\makeblock\src
[arduino installation directory]\libraries\makeblock\example
….
- or like this (on Mac):
[arduino directory]\Contents\Java\libraries\makeblock\src
[arduino directory]\Contents\Java\libraries\makeblock\example
…
3. Open the Arduino Application. If already open it, you need to restart to see changes.
Install the driver
If the driver is not automatically installed on your computer, you can install it manually.
- Windows: CH341SER for Windows
- Mac OSX: CH341SER for MAC
A simple example
In this example, we update the firmware of mBot Ranger.
1. Connect mBot Ranger to your PC with a USB cable. In the Arduino IDE, choose File > Examples > MakeBlockDrive > Firmware_for_Auriga.
2. Choose the board type and COM number.
- Makeblock Auriga — Choose Arduino Mega 2560
- Makeblock Orion — Choose Arduino Uno
- Me Baseboard — Choose Arduino Leonardo
3. Click the Upload icon to compile and upload the code.
After the uploading is complete. The message "Done uploading" is displayed.
You can view some other test programs to learn coding before you create your own projects.
References
Getting Started with Arduino
Makeblock Library: visit Github
Comments
FYI, the link in this article to download Arduino is to an older version, 1.0.6, and it DOES NOT WORK with the update! Arduino throws a series of errors related to the update code. The instructions here clearly show Arduino version 1.6.8. The correct link to download this version is https://www.arduino.cc/en/Main/OldSoftwareReleases#1.0.x. Then scroll down to version 1.6.8.
Also just discovered that the link here for the Makeblock library package is seriously outdated. The current link is https://github.com/Makeblock-official/Makeblock-Libraries
Thanks for Mike's feedback. The content on this page has been updated.
Where can I find documentation for the Me Auriga?
Hi Ore, here is a newly-released article about Me Auriga. Hope it helps!
It says that I'm not authorized to access this page.
Hi Shane, please let me know which page it was by sharing the link to it. Thank you!
https://support.makeblock.com/hc/en-us/articles/4412149618327
Hi Shane, sorry for the trouble, the article is visible to everyone now.
I created a document here: https://docs.google.com/document/d/1EpMWJo9pP2J_pstzXA-XHK8t00Z70SCZYwZ_Kl7VLuw/ which some new users may find useful.
Thank you so much!!! This is so helpful and solved "all" my problems!!!
it should be much more visable.
This will make your Ranger move coding with arduino IDE:
#include <MeAuriga.h>
MeEncoderOnBoard Encoder_1(SLOT1);
MeEncoderOnBoard Encoder_2(SLOT2);
int16_t moveSpeed = 200;
void Forward(void)
{
Encoder_1.setMotorPwm(-moveSpeed); // setMotorPwm writes to the encoder controller
Encoder_2.setMotorPwm(moveSpeed); // so setting the speed change instantly
}
void Backward(void)
{
Encoder_1.setMotorPwm(moveSpeed);
Encoder_2.setMotorPwm(-moveSpeed);
}
void BackwardAndTurnLeft(void)
{
Encoder_1.setMotorPwm(moveSpeed/4);
Encoder_2.setMotorPwm(-moveSpeed);
}
void BackwardAndTurnRight(void)
{
Encoder_1.setMotorPwm(moveSpeed);
Encoder_2.setMotorPwm(-moveSpeed/4);
}
void TurnLeft(void)
{
Encoder_1.setMotorPwm(-moveSpeed);
Encoder_2.setMotorPwm(moveSpeed/2);
}
void TurnRight(void)
{
Encoder_1.setMotorPwm(-moveSpeed/2);
Encoder_2.setMotorPwm(moveSpeed);
}
void TurnLeft1(void)
{
Encoder_1.setMotorPwm(-moveSpeed);
Encoder_2.setMotorPwm(-moveSpeed);
}
void TurnRight1(void)
{
Encoder_1.setMotorPwm(moveSpeed);
Encoder_2.setMotorPwm(moveSpeed);
}
void Stop(void)
{
Encoder_1.setMotorPwm(0);
Encoder_2.setMotorPwm(0);
}
void ChangeSpeed(int16_t spd)
{
moveSpeed = spd;
}
void setup()
{
Serial.begin(115200);
//Set PWM 8KHz
TCCR1A = _BV(WGM10);
TCCR1B = _BV(CS11) | _BV(WGM12);
TCCR2A = _BV(WGM21) | _BV(WGM20);
TCCR2B = _BV(CS21);
}
void loop()
{
ChangeSpeed(200);
Forward();
delay(2000);
Backward();
delay(2000);
TurnLeft1();
delay(2000);
TurnRight1();
delay(2000);
Stop();
delay(3000);
}
Please sign in to leave a comment.