Skip to content

Commit 9b9abd5

Browse files
committed
initial commit
0 parents  commit 9b9abd5

File tree

240 files changed

+24937
-0
lines changed

Some content is hidden

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

240 files changed

+24937
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Deploy to Server
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'README.md'
9+
- '.github/**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-deploy:
14+
name: Build and Deploy
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v6
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version: 22
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build website
32+
run: npm run build
33+
34+
- name: Deploy to Server via rsync
35+
uses: easingthemes/[email protected]
36+
with:
37+
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
38+
REMOTE_HOST: ${{ secrets.SSH_HOST }}
39+
REMOTE_USER: ${{ secrets.SSH_USER }}
40+
REMOTE_PORT: ${{ secrets.SSH_PORT }}
41+
SOURCE: "build/"
42+
TARGET: ${{ secrets.TARGET_DIR }}
43+
ARGS: "-avz --delete"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR Build Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Review gh actions docs if you want to further define triggers, paths, etc
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9+
paths-ignore:
10+
- 'README.md'
11+
- '.github/**'
12+
jobs:
13+
test-deploy:
14+
name: Test deployment
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
- name: Test build website
28+
run: npm run build
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: PR Image Format Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
check-images:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check for new images via API and comment
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const issue_number = context.issue.number;
20+
const owner = context.repo.owner;
21+
const repo = context.repo.repo;
22+
const botCommentIdentifier = "<!-- Image Format Check by GitHub Action -->";
23+
24+
console.log("Fetching files from PR via GitHub API...");
25+
const files = await github.paginate(github.rest.pulls.listFiles, {
26+
owner,
27+
repo,
28+
pull_number: issue_number,
29+
per_page: 100,
30+
});
31+
32+
const newImages = files
33+
.filter(file => file.status === 'added' && /\.(jpg|jpeg|png)$/i.test(file.filename))
34+
.map(file => file.filename);
35+
36+
console.log("Searching for previous comments from this action...");
37+
const { data: comments } = await github.rest.issues.listComments({
38+
owner,
39+
repo,
40+
issue_number,
41+
});
42+
43+
const botComments = comments.filter(comment => comment.body.includes(botCommentIdentifier));
44+
45+
if (botComments.length > 0) {
46+
console.log(`Found ${botComments.length} old comment(s) to delete.`);
47+
const deletePromises = botComments.map(comment =>
48+
github.rest.issues.deleteComment({
49+
owner,
50+
repo,
51+
comment_id: comment.id,
52+
})
53+
);
54+
await Promise.all(deletePromises);
55+
console.log("Successfully deleted old comment(s).");
56+
}
57+
58+
if (newImages.length > 0) {
59+
console.log(`Found ${newImages.length} new JPG/JPEG/PNG images. Creating a new comment.`);
60+
61+
const fileList = newImages.map(file => `- \`${file}\``).join('\n');
62+
63+
// The body content is defined here without any leading whitespace on each line
64+
// to ensure correct Markdown rendering in the final GitHub comment.
65+
const bodyTemplate = `${botCommentIdentifier}
66+
### 🖼️ Image Format Check
67+
68+
Hello! We've detected the following newly added JPG, JPEG, or PNG images in this pull request:
69+
70+
${fileList}
71+
72+
For better web performance and smaller file sizes, please consider converting them to a more modern format like **WebP**.
73+
74+
Thank you for your contribution! ✨
75+
76+
---
77+
78+
<details>
79+
<summary>💡How to Convert?</summary>
80+
81+
<br\>
82+
83+
You can use Google's official \`cwebp\` command-line tool for conversion. It's efficient and powerful.
84+
85+
<strong>Download \`cwebp\` Command-Line Tool</strong>
86+
87+
You can download the pre-compiled toolkits: https://developers.google.com/speed/webp/download After downloading and extracting, you can find the \`cwebp\` executable in the \`bin\` directory.
88+
89+
**Example Command:**
90+
\`\`\`bash
91+
# -q 80 sets the quality factor to 80 (0-100), a good balance between quality and file size.
92+
cwebp -q 80 your_image.jpg -o your_image.webp
93+
\`\`\`
94+
95+
</details>`
96+
97+
;
98+
99+
const body = bodyTemplate.split('\n').map(line => line.trimStart()).join('\n');
100+
101+
await github.rest.issues.createComment({
102+
owner,
103+
repo,
104+
issue_number,
105+
body,
106+
});
107+
console.log("Successfully created a new instructional comment.");
108+
109+
} else {
110+
console.log("No new JPG/JPEG/PNG images found. No comment will be posted.");
111+
}

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# VS Code
23+
.vscode
24+
25+
# Antigravity
26+
.agent

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Waveshare Docs
2+
3+
This repository contains the source code for the [Waveshare Docs Platform](https://docs.waveshare.com).
4+
5+
Our goal is to continuously improve documentation quality, lower the learning curve for users, and make development simpler and more efficient.
6+
7+
## Issue Reporting
8+
9+
If you encounter any issues during use, please feel free to report them through the following methods:
10+
11+
- Submit issues or suggestions on the [Issues](https://github.com/waveshareteam/Docs_en/issues/new) page of this project
12+
13+
## Local Development
14+
15+
This project is built with [Docusaurus](https://docusaurus.io/). Follow these steps to preview and build locally:
16+
17+
```sh
18+
# Install dependencies
19+
npm ci
20+
21+
# Start local preview
22+
npm run start
23+
24+
# Build static files
25+
npm run build
26+
27+
# Preview static files locally
28+
npm run serve
29+
```
30+
31+
## Contribution Guide
32+
33+
We welcome contributions to improve the documentation! Here is how you can help:
34+
35+
1. **Fork the Repository** - Fork this repository to your GitHub account.
36+
2. **Local Modifications** - Clone the repository to your local machine and make your modifications.
37+
3. **Submit PR** - Create a Pull Request, detailing the content and purpose of your changes.
38+
4. **Await Merge** - We will review your PR and merge it once approved.
39+
40+
---
41+
42+
Thank you for supporting Waveshare Docs!
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
sidebar_position: 2
3+
title: Arduino
4+
slug: /ESP32-C3-Zero/Development-Environment-Setup-Arduino
5+
product_family:
6+
- ESP32
7+
product_model:
8+
- ESP32-C3-Zero
9+
- ESP32-C3-Zero-M
10+
- ESP32-C3-Zero-Basic-Kit
11+
---
12+
13+
import ArduinoTutorialIntro from '@site/docs/ESP32/snippets/ArduinoTutorialIntro.mdx';
14+
15+
<!-- Image References -->
16+
import enableUsbcdc from './images/Enable-USBCDC.webp';
17+
import arduinoideEsp32c3zero from './images/ESP32-C3-Zero-Arduino.webp';
18+
19+
# Arduino Development
20+
21+
This chapter includes the following sections; please read according to your needs:
22+
23+
- [Arduino Tutorial for Beginners](#arduino-tutorial-for-beginners)
24+
- [Environment Setup](#environment-setup)
25+
26+
<ArduinoTutorialIntro />
27+
28+
## Environment Setup
29+
30+
### 1. Installing and Configuring Arduino IDE
31+
32+
Please refer to the **[Arduino IDE Setup Tutorial](/docs/ESP32/Tutorials/Arduino-Tutorials/01-Arduino-IDE-Setup.md)** to download and install the Arduino IDE, and add ESP32 support.
33+
34+
### 2. Additional Tips
35+
36+
1. The ESP32-C3-Zero supports direct model selection in the Arduino IDE. Select "Waveshare ESP32-C3-Zero".
37+
38+
<div style={{maxWidth:650}}> <img src={arduinoideEsp32c3zero} alt="Select ESP32-C3-Zero in Arduino IDE"/></div>
39+
40+
2. The ESP32-C3-Zero uses the ESP32-C3 native USB interface, not UART-to-USB. For serial communication:
41+
42+
- The `printf()` function can be used directly;
43+
44+
- To use the `Serial.println()` function, you need to enable the USB CDC feature. Please follow the steps below to check and confirm that your environment is configured correctly:
45+
46+
1. Update ESP32 libraries: It is recommended to update the ESP32 board library in the Arduino IDE to **version 3.3.5 or higher**. Newer versions of the library have USB CDC enabled by default for this board.
47+
48+
2. Check configuration options: In the Arduino IDE "Tools" menu, check and confirm that the "USB CDC On Boot" option is set to "Enabled".
49+
50+
:::note
51+
As shown below, the "USB CDC On Boot" option should be `Enabled` when correctly configured.
52+
53+
<div style={{maxWidth:600}}> <img src={enableUsbcdc} alt="Enable usbcdc"/></div>
54+
55+
:::
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
sidebar_position: 5
3+
title: FAQ
4+
slug: /ESP32-C3-Zero/FAQ
5+
product_family:
6+
- ESP32
7+
product_model:
8+
- ESP32-C3-Zero
9+
- ESP32-C3-Zero-M
10+
- ESP32-C3-Zero-Basic-Kit
11+
---
12+
13+
import Details from '@theme/Details';
14+
15+
# Product FAQ
16+
17+
<Details summary="Q: Can the ESP32-C3-Zero be powered via pins?" className="faq-details" open>
18+
19+
A: Yes. When using an external power supply, you can input 3.7V~6V at the castellated hole marked with "5V".
20+
21+
</Details>
22+
23+
24+
<Details summary="Q: Why is there no response after uploading a program to the ESP32-C3-Zero?" className="faq-details" open>
25+
26+
A: Press the Reset button to restart the device and check if there is any output.
27+
28+
</Details>
29+
30+
31+
<Details summary="Q: How do I perform hardware debugging and flashing on the ESP32-C3-Zero? Do I just connect it to the computer via the Type-C port?" className="faq-details" open>
32+
33+
A: Yes. If flashing fails, hold down the BOOT button while connecting the device to the computer, and then release it.
34+
35+
</Details>
36+
37+
38+
<Details summary="Q: Does the ESP32-C3-Zero support IPv6?" className="faq-details" open>
39+
40+
A: Yes, the ESP32-C3 supports IPv6 and provides IPv6 example programs.
41+
42+
</Details>
43+
44+
<Details summary="Q: Why are the colors displayed incorrectly when controlling the onboard RGB LED (WS2812) of the ESP32-C3-Zero (e.g., setting it to red results in green)?" className="faq-details" open>
45+
A: This is caused by a mismatch in the color data order. The color data format for the onboard LED of the ESP32-C3-Zero is RGB (Red-Green-Blue). To resolve this, please specify the color order parameter as RGB in the initialization settings of the driver library.
46+
</Details>

0 commit comments

Comments
 (0)