Internet of Things: Arduino Web IDE

Introduction

 
In the last segment, we discovered "Arduino IDE" that needs to be downloaded and enabled utilizing your CPU time. So many times it's hard to invest any of the CPU time using Arduino IDE.

Arduino.cc released an Arduino IDE online interface, branded as the "Arduino Web Editor." You can build, check, and deploy in the cloud without uploading, importing, and running it.

This chapter provides details about the web host "Arduino Web Editor."
 

Arduino Web Editor

 
The Arduino Web Editor allows you to write the code and upload sketches to any Arduino and Genuino board from your Web Browser (Chrome, Firefox, Safari, and Edge) after installing a plugin. It works with any official Arduino & Genuino board.
 
This IDE (Integrated Development Environment) is a part of Arduino Create, which is an online platform that enables the makers to write the code, access tutorials, configure boards, and share the projects. Designed to provide users with a continuous Workflow, Arduino Create connects the dots between each part of a maker’s journey from inspiration to implementation, which means, you now have an ability to manage every aspect of your project right from a single dashboard.
 
 
Arduino Web Editor is hosted online. Therefore, it will always be up-to-date with the latest features and support for new boards.
 
This IDE lets you write the code and save it to Cloud, always backing it up and making it accessible from any device. It automatically recognizes any Arduino and Genuino board connected to your PC and configures itself accordingly.
 
An Arduino account is all you need to get started.
 
Sign up to Arduino
 
Go to arduino.cc and click the ‘Sign Up’ link in the upper right corner of the page. Complete the registration form, hit the ‘Create Account’ button. You will receive an e-mail with a link to activate your account. Select the link and a new page will open with your confirmed account information.
 
Note, you can also use this account to write the posts on Arduino’s official Forum, buy products on the online stores, add comments on the blog, as well as create tutorials on the Arduino Project Hub (YAY!).
 
 
Log in to Arduino Web Editor
 
Once you have successfully registered for Arduino, i.e. you created an Arduino account, go to create.arduino.cc/editor. After accepting the term and conditions, you will receive an e-mail with a link to the forum, where you can report any bugs, which you may encounter and share your feedback.
 
Follow a simple flow to install the Arduino Web Editor plugin, which permits you to upload the sketches from the Browser onto your boards. At the end of the plugin installation flow, you will be redirected to the Arduino login page— it’s time to use your credentials.
 
 
Arduino Web Editor anatomy
 
After logging in, you are ready to start using the Arduino Web Editor. The Web app is divided into three main columns.
 
 
The first column lets you navigate between
  • Your Sketchbook: a collection of all your sketches (’sketch’ is what the programs you upload on your board are called).
  • Examples: Read-only sketches that demonstrate all the basic Arduino commands (built-in tab) and the behavior of your libraries (from the libraries tab).
  • Libraries- It comprises of the packages that can be included in your sketch to provide extra functionalities.
  • Serial monitor- a feature that enables you to receive and send the data to your board via USB cable.
  • Help: It provides helpful links and a glossary about Arduino terms.
  • Preferences: Options to customize the look and behavior of your editors, such as text size and color theme
When selected, every menu item shows its options in a side panel (second column).
 
In the third column, the code area is the one you will use the most. Here, you can write the code, verify it, and upload it to your boards, save your sketches on the Cloud and share them with anyone you want.
 
Make your board blink from the browser
 
So far, you’ve set up your online IDE. Let’s make sure your computer can talk to the board; it’s time to make sure that you can upload a program.
 
  • Double-check if the Web Editor is displayed in the way desired by you like checking the Preferences panel for a few options
  • Connect your Arduino or Genuino board to your computer. Boards and serial ports are auto-discovered and selectable in a single dropdown. Pick Arduino/Genuino 101 from the list.
  • Let’s try an example- Choose ‘Examples’ on the menu on the left followed by ‘Basic’ and ‘Blink.’ The Blink sketch is now displayed in the code area.
  • To upload it to your board, press the ‘Upload’ button (arrow right) near the dropdown. A ‘BUSY’ label replaces the buttons during code verifying and uploading. If the upload is successful, the message “Success: Done uploading” will appear in the bottom output area.
  • Once the upload is complete, it should take around five seconds for the 101 board to reset and restart. You should then see on your board; the Yellow LED with an L next to it starts blinking. See the following figure. If this is the case, then congratulations. You have successfully programmed your board to blink its onboard LED.
  • Sometimes, your brand new Arduino/Genuino is already programmed with the Blink sketch, so you can’t tell if you are truly in control. If this is the case, change the delay time by changing the number in the parenthesis to 100 and upload the Blink sketch again. Now, LED should blink much faster. Congratulations, you are really in control.
Document your projects
 
Now, select the Fade sketch from the Examples panel.
 
 
Open the ‘layout.png’ and ‘schematic.png’ tab. These illustrations will show you how to put together your electronics. When you are working on your own projects, you can add your own documentation images by clicking on the last tab of the code area and choosing ‘Import File into Sketch.’
 
 
Share your Sketches
 
Every sketch which you create has a unique URL, similar to Google Docs. Press the ‘Share’ button and copy the URL provided into a new tab of your browser to check it out.
 
 
If you give the URL to someone, they will be able to see your code, add a copy of it to their Sketchbook in the Cloud, or download it. If you write a tutorial onProject Hub and add the link in the Software section, your code will be embedded and will always remain up-to-date.
 
 
We envision Arduino Sketch as the unit that includes everything that you need to bring an idea to life. When someone shares a sketch with you, you’ll both have access to the code, the layout for the electronics, as well as the full tutorial (when available). This will provide you with all the necessary information to build on top of the original project, thereby making it your own.
 
You can even embed your sketch on a Webpage by copying the code provided in the Share Window.
 
Libraries and the Arduino Web Editor
 
Arduino community has written over 700 libraries that you can include in your sketches without having to install a thing. You can browse through all of them in the Library Manager and the favorite ones that you like the most. All the libraries available in the Library Manager are automatically detected, so you’ll never need to install them to get your code to compile.
 
 
Since all the contributed libraries are up on our Servers, if you use them and then you share your sketch with someone, they could just add a copy of your code to their sketchbook and will be able to compile it without having to do anything else.
 
We know that sharing a sketch and its related libraries can be cumbersome using the Web Editor but you can really speed up this process. Try for instance this Thermostat Bot sketch that uses a variety of the contributed libraries.
 
 
What if you want to select a specific version of a library? Look for it on the Library Manager and star it. It will show up on the Favorite tab of the Libraries panel. From there, you can select a specific version and include it in your sketch. We are adding metadata to the sketch about the version number so we can tell Arduino Builder to pick the one, you really want. When building your sketch, we will always look at your custom libraries first, then to your favorite ones, and lastly to the Arduino built-in libraries.
 
If you have a favorite library, you can also see its related examples, get more information, and a link to the GitHub repository and download it.
 
That’s all for this chapter. I hope you enjoyed reading!!
Author
Stephen Simon
Admin 210.8k 697.3k
Next » Internet of Things: Arduino Serial Monitor