Tuesday, May 12, 2015

05. Compiling and sending GRBL on Arduino

Now that we are done with Arduino basic installation, I need to move into GRBL compilation and upload it into Arduino.

As per https://github.com/grbl/grbl/wiki/Compiling-Grbl, I take the following steps:

1. Download the Grbl source code (v0.9i)
  • On GRBL Git page: https://github.com/grbl/grbl
  • Click the "Download ZIP" button on the lower right side of the home page.
  • Once downloaded, unzip it and you'll have a folder called GRBL-Master or something similar.
2. Load Grbl into the Arduino IDE as a Library.
  • Launch the Arduino IDE on the PC.
  • On Arduino IDE menu, click "Sketch", then "Include Library", then "Add .ZIP Library..." (note that this still works with a folder / prior to IDE version 1.6.2 this will be Import Library..., and click Add Library...).
  • Select the Grbl folder inside the grbl-master folder when asked to select a library folder you'd like to add. The correct folder only contains the source files and an example directory.
  • It may take a few seconds for the Arduino IDE to import it.
3. Open the GrblUpload Arduino example.
  • Click the File down-down menu, navigate to Examples->Grbl, and select GrblUpload.
4. Compile and upload Grbl to your Arduino.
  • Connect your Arduino Uno to your computer.
  • Make sure your board is set to the Arduino Uno in the Tool->Board menu and the serial port is selected correctly in Tool->Serial Port.
  • Click the Upload, and Grbl should compile and flash to your Arduino! (Flashing with a programmer also works by using the Upload Using Programmer menu command.)
5. To check that these steps are performed correctly, I can start using GBRL on my Arduino from my Arduino IDE on my PC, as explained here: https://github.com/grbl/grbl/wiki/Using-Grbl

So I take the following steps:
  • In Arduino IDE, under Tools, I select "Serial monitor": a window pops up
  • I change baud rate to 115200: I get GBRL following message "gbrl 0.9i ['$' for help]"


Good ! It working fine so far.
  • I also change the "No line ending" drop-down menu to "Carriage return".
  • I enter "$" and then click "send": I get few lines of help description:
Great !!

No comments:

Post a Comment