Skip to content

Commit 37a0879

Browse files
authored
Debugger (#167)
1 parent 4075e15 commit 37a0879

36 files changed

+3362
-1017
lines changed

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,53 @@
11
# CircuitPython Online IDE
2+
23
> The easiest way to code CircuitPython. **No installation** required. Perfect for **Education** and **Hobbyists**. Supports **Chromebooks**.
34
4-
[![Launch IDE](https://img.shields.io/badge/🚀_Launch-Open_Web_Editor-green?style=for-the-badge&logo=google-chrome)](https://urfdvw.github.io/circuitpython-online-ide-2)
5-
---
5+
## [![Launch IDE](https://img.shields.io/badge/🚀_Launch-Open_Web_Editor-green?style=for-the-badge&logo=google-chrome)](https://urfdvw.github.io/circuitpython-online-ide-2)
66

77
![CircuitPython Online IDE Demo](/docs/media/main.png)
88

99
---
1010

1111
## Why use this IDE?
1212

13-
* **Instant Setup:** This IDE runs entirely in your browser. Just plug in your board and start coding.
14-
* **Powerful tools:** Comes with a built-in **Library Manager** and **Serial Plotter**.
15-
* **Education Ready:** Works flawlessly on school **Chromebooks** where installing software is blocked.
13+
- **Instant Setup:** This IDE runs entirely in your browser. Just plug in your board and start coding.
14+
- **Powerful tools:** Comes with a built-in **Library Manager** and **Serial Plotter**.
15+
- **Education Ready:** Works flawlessly on school **Chromebooks** where installing software is blocked.
1616

1717
---
1818

1919
## Key Features
2020

21+
### 🐞 Debugger
22+
23+
The first-ever visual debugger for CircuitPython is here! Step through your code, set breakpoints or conditional breakpoints, track variables, and rewind time to catch bugs before they happen.
24+
25+
![Debugger](/docs/media/debugger.png)
26+
2127
### 📦 One-Click Library Manager
28+
2229
Never worry about dependencies again! Just write your code, and the IDE will analyze your imports and install all required libraries with a single click. You can also search and browse the entire Adafruit and Community Bundle to discover available libraries.
2330

2431
![Library Manager Screenshot](/docs/media/library_management.png)
2532

2633
### 📈 Built-in Serial Plotter
34+
2735
Visualizing sensor data? You don't need external tools. Plots numeric data from the serial output in real-time. Perfect for STEM experiments.
2836

2937
![Serial Plotter Screenshot](/docs/media/plotter.png)
3038

3139
### 📂 Visual File Management
40+
3241
Manage files on your microcontroller just like on your computer. Create, edit, and organize without leaving the browser.
3342

3443
![Folder View Screenshot](/docs/media/folder_view.png)
3544

3645
### 📷 Camera View
46+
3747
Showcase your microcontroller to others during streaming, remote learning or collaboration. Share your camera feed directly through the IDE.
3848

3949
![Camera View Screenshot](/docs/media/camera.png)
4050

41-
4251
---
4352

4453
## Quick Start
@@ -53,19 +62,19 @@ Showcase your microcontroller to others during streaming, remote learning or col
5362

5463
## Compatibility
5564

56-
* **Hardware:** Supports all CircuitPython boards.
57-
* **OS:** All desktop OSes including Chromebooks.
58-
* **Browsers:** Google Chrome, or Chromium-based browsers such as Microsoft Edge, Opera.
65+
- **Hardware:** Supports all CircuitPython boards.
66+
- **OS:** All desktop OSes including Chromebooks.
67+
- **Browsers:** Google Chrome, or Chromium-based browsers such as Microsoft Edge, Opera.
5968

6069
---
6170

6271
## Feedback & Community
6372

64-
* **Tell me your story!** [Fill out the Survey](https://docs.google.com/forms/d/e/1FAIpQLSdupiJIRViFwPpuQC1hMp8gRvhxACLoAjgepm_-IRZumwK7Cg/viewform)
65-
* **Found a bug?** [Check out this guide](https://github.com/urfdvw/circuitpython-online-ide-2/blob/main/src/docs/Feedback%20and%20Code%20Contribution.md)
66-
* **Follow Me:**
67-
* YouTube: [@Riverwang](https://www.youtube.com/channel/UCeunCRTBkjHWynMl4I4le_A)
68-
* Twitter: [@River___Wang](https://twitter.com/River___Wang)
69-
* Mastodon: [@Riverwang](https://fosstodon.org/@Riverwang)
73+
- **Tell me your story!** [Fill out the Survey](https://docs.google.com/forms/d/e/1FAIpQLSdupiJIRViFwPpuQC1hMp8gRvhxACLoAjgepm_-IRZumwK7Cg/viewform)
74+
- **Found a bug?** [Check out this guide](https://github.com/urfdvw/circuitpython-online-ide-2/blob/main/src/docs/Feedback%20and%20Code%20Contribution.md)
75+
- **Follow Me:**
76+
- YouTube: [@Riverwang](https://www.youtube.com/channel/UCeunCRTBkjHWynMl4I4le_A)
77+
- Twitter: [@River\_\_\_Wang](https://twitter.com/River___Wang)
78+
- Mastodon: [@Riverwang](https://fosstodon.org/@Riverwang)
7079

7180
**If this project helped you, please give it a Star ⭐️ on GitHub!**

dev logs/debugger review.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- [x] start/end indicator
2+
- [x] stop/restart button
3+
- [x] step running indicator
4+
- [x] UI differentiate step running or waiting on user step or continue
5+
- [x] auto start on debugger page
6+
- [x] need hint on when preparing
7+
- [x] auto re-instrumentation
8+
- UI refine into better workflow
9+
- [x] only one button left in toolbar to reduce confusion
10+
- I wanted to keep the button on the top instead of at the button, so that always visible and no need to scroll to see the button
11+
- [x] select 'code.py' by default and will alert when the last file is deselected.
12+
- [x] the first page is moved to backup if CIRCUITPY is not connected

docs/index.html

Lines changed: 908 additions & 546 deletions
Large diffs are not rendered by default.

docs/media/debugger.png

69.6 KB
Loading

docs/service-worker.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,19 @@ self.addEventListener("fetch", (event) => {
4848
return cache.match(event.request).then((cachedResponse) => {
4949
const fetchPromise = fetch(event.request)
5050
.then((networkResponse) => {
51-
// Update the cache with the fresh resource
52-
cache.put(event.request, networkResponse.clone());
53-
return networkResponse;
54-
})
51+
// Only cache GET requests and successful responses.
52+
// The Cache API only supports caching GET requests; attempting to
53+
// cache other methods (e.g. HEAD) will throw a TypeError.
54+
try {
55+
if (event.request.method === 'GET' && networkResponse && networkResponse.ok) {
56+
cache.put(event.request, networkResponse.clone());
57+
}
58+
} catch (cacheErr) {
59+
// Log and continue; do not let caching errors break responses.
60+
console.warn('Service worker cache.put failed:', cacheErr);
61+
}
62+
return networkResponse;
63+
})
5564
.catch(() => {
5665
// Network request failed; if there's a cache, serve it
5766
console.log("Serving cached response for " + event.request.url);

docs/tree-sitter-python.wasm

447 KB
Binary file not shown.

0 commit comments

Comments
 (0)