From 408dcb5b51e5c470447fad412e31857b7a96f772 Mon Sep 17 00:00:00 2001 From: sivar2311 Date: Sun, 7 Dec 2025 17:47:32 +0100 Subject: [PATCH] Fix segment pin initialization in tutorial Updated segment pin initialization for 7-segment display. --- docs/chips-api/tutorial-7seg.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/chips-api/tutorial-7seg.md b/docs/chips-api/tutorial-7seg.md index c4373ed..cb1a047 100644 --- a/docs/chips-api/tutorial-7seg.md +++ b/docs/chips-api/tutorial-7seg.md @@ -90,12 +90,12 @@ typedef struct { Next, add the following code to `chip_init` (after the line that defines `chip`): ```C chip->segment_pins[0] = pin_init("SEG_A", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_B", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_C", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_D", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_E", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_F", OUTPUT_HIGH); -chip->segment_pins[0] = pin_init("SEG_G", OUTPUT_HIGH); +chip->segment_pins[1] = pin_init("SEG_B", OUTPUT_HIGH); +chip->segment_pins[2] = pin_init("SEG_C", OUTPUT_HIGH); +chip->segment_pins[3] = pin_init("SEG_D", OUTPUT_HIGH); +chip->segment_pins[4] = pin_init("SEG_E", OUTPUT_HIGH); +chip->segment_pins[5] = pin_init("SEG_F", OUTPUT_HIGH); +chip->segment_pins[6] = pin_init("SEG_G", OUTPUT_HIGH); ``` 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: compiles the chips and creates a release whenever you push a tag. Here's an [example for a Wokwi project](https://wokwi.com/projects/350946636543820370) that uses this chip. Note the - "dependencies" section in `diagram.json` - it tells Wokwi where to look for the chip implementation on GitHub. \ No newline at end of file + "dependencies" section in `diagram.json` - it tells Wokwi where to look for the chip implementation on GitHub.