Skip to content

Commit 38f49dd

Browse files
committed
Merge branch 'main' into jacobhylen/P&M-launch
2 parents 2acc398 + 9226fb5 commit 38f49dd

File tree

168 files changed

+2097
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2097
-287
lines changed

.github/workflows/deploy-prd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- main
88

99
concurrency:
10-
group: deploy-production
10+
group: deploy-prd
1111
cancel-in-progress: true
1212

1313
jobs:
@@ -33,11 +33,12 @@ jobs:
3333

3434
- name: Copy Static Files
3535
run: |
36-
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
36+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
3737
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
3838
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
3939
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
4040
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
41+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
4142
4243
- name: Gatsby main cache
4344
uses: actions/cache@v4
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy to docs-content.arduino.cc
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: deploy-production
11+
cancel-in-progress: true
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
build:
19+
if: "github.repository == 'arduino/docs-content'"
20+
runs-on: ubuntu-latest
21+
environment: production
22+
env:
23+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
24+
APP_ENV: prod
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 18
33+
cache: "npm"
34+
cache-dependency-path: "**/package-lock.json"
35+
36+
- name: Render Datasheets
37+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
38+
39+
- name: Copy Static Files
40+
run: |
41+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
42+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
43+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
44+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
45+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
46+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
47+
48+
- name: Gatsby main cache
49+
uses: actions/cache@v4
50+
id: gatsby-cache-folder
51+
with:
52+
path: .cache
53+
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
54+
restore-keys: |
55+
${{ runner.os }}-cache-gatsby-
56+
57+
- name: Gatsby Public Folder
58+
uses: actions/cache@v4
59+
id: gatsby-public-folder
60+
with:
61+
path: public/
62+
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
63+
restore-keys: |
64+
${{ runner.os }}-public-gatsby-
65+
66+
- run: npm install
67+
- run: npm run build
68+
69+
- name: Configure AWS credentials from Production account
70+
uses: aws-actions/configure-aws-credentials@v4
71+
with:
72+
role-to-assume: ${{ secrets.PRODUCTION_IAM_ROLE }}
73+
aws-region: us-east-1
74+
75+
- name: Sync all cacheable assets
76+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
77+
78+
- name: Sync all non-cacheable assets
79+
# Don't cache any HTML or JSON file: they should always be up-to-dates
80+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/

.github/workflows/deploy-staging.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy to docs-content.oniudra.cc
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- ghaction
8+
9+
concurrency:
10+
group: deploy-staging
11+
cancel-in-progress: true
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
environment: staging
21+
env:
22+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
23+
APP_ENV: staging
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- run: git log -1 --pretty=format:%aI content/learn/04.electronics/05.servo-motors/servo-motors.md
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 18
33+
cache: "npm"
34+
cache-dependency-path: "**/package-lock.json"
35+
36+
- name: Render Datasheets
37+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
38+
39+
- name: Copy Static Files
40+
run: |
41+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
42+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
43+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
44+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
45+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
46+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
47+
48+
- name: Gatsby main cache
49+
uses: actions/cache@v4
50+
id: gatsby-cache-folder
51+
with:
52+
path: .cache
53+
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
54+
restore-keys: |
55+
${{ runner.os }}-cache-gatsby-
56+
57+
- name: Gatsby Public Folder
58+
uses: actions/cache@v4
59+
id: gatsby-public-folder
60+
with:
61+
path: public/
62+
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
63+
restore-keys: |
64+
${{ runner.os }}-public-gatsby-
65+
66+
- run: npm install
67+
- run: npm run build
68+
69+
- name: Configure AWS credentials from Staging account
70+
uses: aws-actions/configure-aws-credentials@v4
71+
with:
72+
role-to-assume: ${{ secrets.STAGING_IAM_ROLE }}
73+
aws-region: us-east-1
74+
75+
- name: Sync all cacheable assets
76+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
77+
78+
- name: Sync all non-cacheable assets
79+
# Don't cache any HTML or JSON file: they should always be up-to-dates
80+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/

.github/workflows/deploy-stg.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- ghaction
88

99
concurrency:
10-
group: deploy-staging
10+
group: deploy-stg
1111
cancel-in-progress: true
1212

1313
jobs:
@@ -33,11 +33,12 @@ jobs:
3333

3434
- name: Copy Static Files
3535
run: |
36-
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
36+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
3737
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
3838
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
3939
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
4040
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
41+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
4142
4243
- name: Gatsby main cache
4344
uses: actions/cache@v4

.github/workflows/preview.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
issue-number: ${{ github.event.pull_request.number }}
3434
comment-author: "github-actions[bot]"
3535
body-includes: "Preview Deployment"
36-
36+
3737
- name: Update Comment if exists
3838
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
3939
uses: peter-evans/[email protected]
@@ -57,11 +57,12 @@ jobs:
5757

5858
- name: Copy Static Files
5959
run: |
60-
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
60+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
6161
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
6262
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
6363
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
6464
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
65+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
6566
6667
- name: Gatsby main cache
6768
uses: actions/cache@v4
@@ -107,7 +108,7 @@ jobs:
107108
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
108109
--json \
109110
> deploy_output.json
110-
111+
111112
- name: Generate URL Preview
112113
if: github.event_name == 'pull_request'
113114
id: url_preview
@@ -124,7 +125,7 @@ jobs:
124125
## Preview Deployment
125126
🚀 Preview this PR: ${{ steps.url_preview.outputs.NETLIFY_PREVIEW_URL }}
126127
📍 Commit SHA: ${{ github.sha }}
127-
128+
128129
- name: Update PR Preview Comment
129130
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
130131
uses: peter-evans/[email protected]

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ node_modules
77
public
88
src
99
.DS_Store
10-
.vscode/settings.json
10+
.vscode/settings.json
11+
content/en
12+
content/de
13+
content/pt

content/_dev-test/content.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: ""
3+
title: ""
4+
categories: ""
5+
subCategories: ""
6+
leaf: false
7+
mainDescription: ""
8+
mainTitle: ""
9+
---
-1.12 MB
Loading

content/arduino-cloud/03.cloud-interface/00.sketches/sketches.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,35 @@ author: Karl Söderby
88
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++).
99

1010
The Arduino Cloud has two categories of sketches:
11-
- **Regular sketch** - a single `.ino` file where you write a program. These sketches can be used for **any** Arduino board.
12-
- **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.
11+
- **Sketch** - a single `.ino` file where you write a program. These sketches can be used for **any** Arduino board.
12+
- **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.
1313

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

1616
***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.***
1717

1818
## Access Your Sketches
1919

20-
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.
20+
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.
2121

22-
![Sketches in the Arduino Cloud.](assets/sketch.png)
22+
![Sketches in the Arduino Cloud](./assets/sketch.png)
2323

2424
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.
2525

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

28+
### How to Create and Organize Folders
29+
30+
You can easily organize your sketches by creating folders. Here’s how you can do it:
31+
32+
**Create a New Folder**: Click on **Create**, then select **New Folder**.
33+
34+
**Move Sketches into a Folder**:
35+
36+
- **Drag and Drop**: Simply drag the sketch you want to move and drop it into the desired folder.
37+
38+
- **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.
39+
2840
## Regular Sketches
2941

3042
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.
@@ -45,11 +57,11 @@ If you are new to the Arduino environment, you can check out the [Language Refer
4557

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

48-
## IoT Sketches
60+
## Sketches with an attached Thing
4961

50-
IoT sketches are more complex and are generated automatically when you create a Thing and variables.
62+
Sketches with an attached Thing are more complex and are generated automatically when you create a Thing and variables.
5163

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

5466
### Sketch File
5567

@@ -122,13 +134,13 @@ The Remote Sketchbook feature is great as you can push/pull your sketches from t
122134
***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.***
123135

124136

125-
## Recommended Code Practices (IoT Sketches)
137+
## Recommended Code Practices (Sketches with an attached Thing)
126138

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

129141
### Watchdog Timer (WDT)
130142

131-
All Arduino Cloud sketches use a **Watchdog Timer (WDT)** by default. The WDT can be used to automatically recover from hardware faults or unrecoverable software errors.
143+
Arduino Cloud sketches use a **Watchdog Timer (WDT)** by default, however, not all boards support this function. The WDT can be used to automatically recover from hardware faults or unrecoverable software errors.
132144

133145
A WDT is essentially a countdown timer, whereas it starts counting from a set value, and upon reaching zero, it resets the board. To prevent it from reaching zero, we continuously call it from the `loop()`, using the `ArduinoCloud.update()` function.
134146

@@ -140,7 +152,7 @@ The WDT can however be disabled inside of the `setup()` function, by adding the
140152
ArduinoCloud.begin(ArduinoIoTPreferredConnection, false).
141153
```
142154

143-
***You can view the source code of this implementation [here](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/src/utility/watchdog).***
155+
***You can view the source code of this implementation [here](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/src/utility/watchdog) and you can check if your board supports this feature [here](https://github.com/arduino-libraries/ArduinoIoTCloud?tab=readme-ov-file#what).***
144156

145157
### Alternatives to Delays
146158

0 commit comments

Comments
 (0)