Skip to content

Commit 408dcb5

Browse files
authored
Fix segment pin initialization in tutorial
Updated segment pin initialization for 7-segment display.
1 parent 032cd74 commit 408dcb5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/chips-api/tutorial-7seg.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ typedef struct {
9090
Next, add the following code to `chip_init` (after the line that defines `chip`):
9191
```C
9292
chip->segment_pins[0] = pin_init("SEG_A", OUTPUT_HIGH);
93-
chip->segment_pins[0] = pin_init("SEG_B", OUTPUT_HIGH);
94-
chip->segment_pins[0] = pin_init("SEG_C", OUTPUT_HIGH);
95-
chip->segment_pins[0] = pin_init("SEG_D", OUTPUT_HIGH);
96-
chip->segment_pins[0] = pin_init("SEG_E", OUTPUT_HIGH);
97-
chip->segment_pins[0] = pin_init("SEG_F", OUTPUT_HIGH);
98-
chip->segment_pins[0] = pin_init("SEG_G", OUTPUT_HIGH);
93+
chip->segment_pins[1] = pin_init("SEG_B", OUTPUT_HIGH);
94+
chip->segment_pins[2] = pin_init("SEG_C", OUTPUT_HIGH);
95+
chip->segment_pins[3] = pin_init("SEG_D", OUTPUT_HIGH);
96+
chip->segment_pins[4] = pin_init("SEG_E", OUTPUT_HIGH);
97+
chip->segment_pins[5] = pin_init("SEG_F", OUTPUT_HIGH);
98+
chip->segment_pins[6] = pin_init("SEG_G", OUTPUT_HIGH);
9999
```
100100

101101
The code initializes each of the segment pins as an output, and sets the initial value to digital high. The 7-segment
@@ -259,4 +259,4 @@ tutorial:
259259
compiles the chips and creates a release whenever you push a tag.
260260
261261
Here's an [example for a Wokwi project](https://wokwi.com/projects/350946636543820370) that uses this chip. Note the
262-
"dependencies" section in `diagram.json` - it tells Wokwi where to look for the chip implementation on GitHub.
262+
"dependencies" section in `diagram.json` - it tells Wokwi where to look for the chip implementation on GitHub.

0 commit comments

Comments
 (0)