Skip to content

[MKC-1612] update sketches article #1951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 21 additions & 9 deletions content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,35 @@ author: Karl Söderby
A sketch is a file where we write programs to run on our Arduino boards. Sketches have a `.ino` extension, which supports the Arduino programming language (a variant of C++).

The Arduino Cloud has two categories of sketches:
- **Regular sketch** - a single `.ino` file where you write a program. These sketches can be used for **any** Arduino board.
- **IoT Sketch** - a set of files that are automatically generated when creating a [Thing](/arduino-cloud/cloud-interface/things). This includes an `.ino` file and two header (`.h`) files that contain your Thing configuration + credentials. Only available for boards with IoT support.
- **Sketch** - a single `.ino` file where you write a program. These sketches can be used for **any** Arduino board.
- **Sketch with attached Thing** - a set of files that are automatically generated when creating a [Thing](/arduino-cloud/cloud-interface/things). This includes an `.ino` file and two header (`.h`) files that contain your Thing configuration + credentials. Only available for boards with Arduino Cloud support.

In this document we will take a look at how to use sketches in the Arduino Cloud environment.
In this document, we will take a look at how to use sketches in the Arduino Cloud environment.

***If you need help getting started with programming your Arduino in the online environment, check out the [Cloud Editor](/arduino-cloud/guides/cloud-editor) tutorial.***

## Access Your Sketches

You can access all your sketches at [app.arduino.cc/sketches](https://app.arduino.cc/sketches), where you can easily select between your regular sketches and IoT sketches.
You can access all your sketches at [app.arduino.cc/sketches](https://app.arduino.cc/sketches). Here you can easily see if your sketch has a Thing connected to it by checking if it has a light blue text box next to it.

![Sketches in the Arduino Cloud.](assets/sketch.png)
![Sketches in the Arduino Cloud](./assets/sketch.png)

Clicking on each sketch will direct you to the [Cloud Editor](https://create.arduino.cc/editor/), which is an online version of the Arduino IDE. Here you can write a program, compile it and upload it to your board.

***To get started with the Cloud Editor, check out the [Cloud Editor](/arduino-cloud/guides/cloud-editor) tutorial.***

### How to Create and Organize Folders

You can easily organize your sketches by creating folders. Here’s how you can do it:

**Create a New Folder**: Click on **Create**, then select **New Folder**.

**Move Sketches into a Folder**:

- **Drag and Drop**: Simply drag the sketch you want to move and drop it into the desired folder.

- **Right-Click and Move**: Alternatively, click the three dots on the right, choose the option "Move to folder", and then select the folder you want to move it to.

## Regular Sketches

A regular sketch in the Arduino Cloud is exactly like a sketch used in the [Arduino IDE](/software/ide-v2), with no difference whatsoever. You can take a sketch from the online IDE and compile it in the offline IDE.
Expand All @@ -45,11 +57,11 @@ If you are new to the Arduino environment, you can check out the [Language Refer

For specific features of a board, make sure to check out the [hardware documentation](/).

## IoT Sketches
## Sketches with an attached Thing

IoT sketches are more complex and are generated automatically when you create a Thing and variables.
Sketches with an attached Thing are more complex and are generated automatically when you create a Thing and variables.

***Read more about this in the [Automatic Sketch Generation](/arduino-cloud/cloud-interface/sketches) documentation.***
***Read more about [Things](/arduino-cloud/cloud-interface/things/).***

### Sketch File

Expand Down Expand Up @@ -122,7 +134,7 @@ The Remote Sketchbook feature is great as you can push/pull your sketches from t
***A very important note on Remote Sketchbook: when you push/pull a sketch, you will overwrite the existing sketch, similarly to how GitHub works, but without the option of retrieving your previous sketch.***


## Recommended Code Practices (IoT Sketches)
## Recommended Code Practices (Sketches with an attached Thing)

This section highlights some important aspects of writing code with regard to the implementations in the [ArduinoIoTCloud](https://github.com/arduino-libraries/ArduinoIoTCloud).

Expand Down
Loading