Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 77cf005

Browse files
committed
add wokwi examples
1 parent ce2734c commit 77cf005

5 files changed

Lines changed: 34 additions & 14 deletions

File tree

website/docs/api/drivers/ssd1306.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: SSD1306
33
---
44

5+
import WokwiEditor from "@site/src/components/WokwiEditor"
6+
57
# SSD1306
68

79
Driver for SSD1306 OLED screen at I2C address `0x3c` (or `0x3d`).
@@ -38,3 +40,7 @@ await ssd.init()
3840
ssd.image.print("Hello world!", 3, 10)
3941
await ssd.show()
4042
```
43+
44+
## Examples
45+
46+
<WokwiEditor projectId="370250148258841601">

website/docs/samples/blinky.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
---
22
sidebar_position: 2
33
description: Learn how to create the classic LED blinking program on Raspberry
4-
Pi Pico and ESP32 using DeviceScript.
4+
Pi Pico and ESP32 using DeviceScript.
55
keywords:
6-
- Raspberry Pi Pico
7-
- ESP32
8-
- LED blinking
9-
- DeviceScript
10-
- microcontroller programming
6+
- Raspberry Pi Pico
7+
- ESP32
8+
- LED blinking
9+
- DeviceScript
10+
- microcontroller programming
1111
hide_table_of_contents: true
1212
---
13+
1314
import StaticVideo from "@site/src/components/StaticVideo"
15+
import WokwiEditor from "@site/src/components/WokwiEditor"
1416

1517
# Blinky
1618

@@ -56,3 +58,5 @@ setInterval(async () => {
5658
await lightBulb.toggle()
5759
}, 500)
5860
```
61+
62+
<WokwiEditor projectId="368689527293414401" />

website/docs/samples/button-led.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ sidebar_position: 3.1
33
hide_table_of_contents: true
44
---
55

6+
import WokwiEditor from "@site/src/components/WokwiEditor"
7+
68
# Button LED
79

810
This sample toggles a LED on/off by listening on the `down` events emitted by a button.
@@ -26,11 +28,4 @@ button.down.subscribe(async () => {
2628
})
2729
```
2830

29-
30-
<iframe style={{
31-
width:"100%",
32-
minHeight: "28rem",
33-
borderRadius: "0.5rem",
34-
padding: ".5rem",
35-
border: "solid 1px #666"
36-
}} src="https://wokwi.com/projects/369061499438874625" />
31+
<WokwiEditor projectId="369061499438874625" />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from "react"
2+
import styles from "./styles.module.css"
3+
4+
export default function WokwiEditor(props: { projectId: string }) {
5+
const { projectId } = props
6+
const url = `https://wokwi.com/projects/${projectId}`
7+
return <iframe className={styles.editor} src={url} />
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.editor {
2+
width: 100%;
3+
min-height: 28rem;
4+
border-radius: 0.5rem;
5+
padding: 0.5rem;
6+
border: solid 1px #666;
7+
}

0 commit comments

Comments
 (0)