Arduino releases an updated version of IDE 2.0 with remote sketchbook integration support. Using this feature any of the sketches created inside Arduino IDE or Arduino web editor can be shared with multiple people’s computers or can be stored online to access from anywhere.
This tutorial will cover all steps on how one can synchronize Arduino sketches between IDE and Arduino cloud web editor. Before we move further let’s discuss some of the benefits of doing this.
- Program Arduino from anywhere
- Program Arduino using the browser without installation of IDE
- A complete code backup
- Can work offline and sync Arduino code later when connection is established
- Share and publish code at anytime and anywhere
Synchronize a Sketch between IDE 2.0 and Arduino Cloud
Synchronizing Arduino sketches between IDE and cloud is very simple. We just need to create an Arduino account and link the IDE with the Arduino web cloud editor. Summary of steps we will follow.
- Create Arduino sketch in cloud editor
- Authenticate Arduino account and linked it with IDE 2.0
- Pull a sketch from cloud
- Edit the Arduino code and again push the sketch back to cloud
Note: The remote sketchbook option doesn’t allow us to push the Arduino sketch created inside Arduino IDE. It only allows you to pull a sketch created inside the web editor and after modifying it in IDE again push back to the cloud. In short, the sketch needs to be originally created inside the Arduino web editor.
Now follow all the steps explained below to synchronize the sketch between IDE and cloud.
Create an Arduino Account
First step is to create an Arduino account. It can be easily created by using the email or by linking the accounts such as Google or GitHub.
Create a Sketch in the Arduino Cloud
After creating the Google account now, we will create a new sketch and write a code in it. Follow steps for creating a new sketch.
Step 1: Open the Arduino Web Editor.
Step 2: Open a new sketch.
Step 3: After creating a new file write the example code given below in the editor window.
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(5000);
digitalWrite(LED, LOW);
delay(5000);
}
Step 4: Change the name of the sketchbook. Here we change it to Test_Web_Editor_Code. This will help to identify the file in the Arduino IDE in case we have multiple sketches opened in the Web editor.
Enabling the Remote Sketchbook in Arduino IDE 2.0
After creating a new sketch file. Next step is to link Arduino IDE 2.0 with Arduino cloud web editor. Follow steps to link IDE 2.0 with Arduino cloud web editor.
Step 1: Now open Arduino IDE and go to sketchbook (1) then select the remote sketchbook (2) option. Click sign in (3) option this will ask for permission to login Arduino cloud into IDE 2.0.
Step 2: Following window will open in default PC browser if the Arduino account is already opened in browser click Accept. Otherwise, login to the Arduino account first.
Step 3: Once the account is successfully logged in, the following message will appear close to the browser window after that.
Step 4: Now open the Arduino IDE remote sketchbook option where we can see the connected status of our account.
We have successfully linked Arduino IDE with Arduino cloud web editor.
Pulling, Editing and Pushing Arduino Sketches
Before we move further, we must know some frequent terms which will be used in synchronizing sketches with Arduino IDE and cloud editor. These terms are
- Pulling: It means downloading or synchronizing sketches from Arduino cloud to Arduino IDE.
- Editing: Edit the sketch which we want to push or pull.
- Pushing: It means uploading or synchronizing sketches from Arduino IDE to Arduino cloud editor.
Now for synchronizing we will download the Arduino sketch created inside the cloud editor. Follow the below mentioned steps.
Step 1: After the Arduino IDE is linked with cloud, we can see all sketchbooks available for download. Click the Pull Sketch button to synchronize the sketchbook from Arduino cloud to Arduino IDE.
Step 2: We can see the same code as written in Arduino web editor will open in Arduino IDE.
Step 3: Now make some changes to code. Here we will change the delay from 5 sec to 1 sec. After changing select the Push Sketch button.
Step 4: Arduino IDE will ask for the permission to push the sketch. By allowing this it will upload the changes to Arduino IDE cloud editor.
Step 5: Open Arduino cloud editor and we can see the same changes we did in Arduino IDE.
We have successfully synchronized sketches between Arduino IDE and Arduino cloud editor.
Disabling the Remote Sketchbook
If one doesn’t want Arduino remote sketchbook it can be easily disabled by going to: File > Advanced > Show/Hide Remote Sketchbook
Note: To enable it again simply click this option again.
Conclusion
Integration of remote sketchbooks with Arduino IDE provides us with great opportunities and gives us full control over Arduino code editing and debugging. We can easily sync sketches between devices. This article will help to set up an Arduino IDE with a remote sketchbook. Read the article for further details.