Skip to content

Remove apostrophes and fix a typo #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gpio/hello_7segment/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Our 7 Segment display has pins as follows.
--D--
----

By default we are allocating GPIO 2 to A, 3 to B etc.
By default we are allocating GPIO 2 to segment A, 3 to B etc.
So, connect GPIO 2 to pin A on the 7 segment LED display and so on. You will need the appropriate resistors (68 ohm should be fine) for each segment.
The LED device used here is common anode, so the anode pin is connected to the 3.3v supply, and the GPIO's need to pull low (to ground) to complete the circuit.
The pull direction of the GPIO's is specified in the code itself.
The LED device used here is common anode, so the anode pin is connected to the 3.3v supply, and the GPIOs need to pull low (to ground) to complete the circuit.
The pull direction of the GPIOs is specified in the code itself.

Connect the switch to connect on pressing. One side should be connected to ground, the other to GPIO 9.

Expand Down
8 changes: 4 additions & 4 deletions gpio/hello_7segment/hello_7segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
E C
--D--

By default we are allocating GPIO 2 to A, 3 to B etc.
So, connect GOIP 2 to pin A on the 7 segment LED display etc. Don't forget
By default we are allocating GPIO 2 to segment A, 3 to B etc.
So, connect GPIO 2 to pin A on the 7 segment LED display etc. Don't forget
the appropriate resistors, best to use one for each segment!

Connect button so that pressing the switch connects the GPIO 9 (default) to
Expand All @@ -28,7 +28,7 @@
#define FIRST_GPIO 2
#define BUTTON_GPIO (FIRST_GPIO+7)

// This array converts a number 0-9 to a bit pattern to send to the GPIO's
// This array converts a number 0-9 to a bit pattern to send to the GPIOs
int bits[10] = {
0x3f, // 0
0x06, // 1
Expand Down Expand Up @@ -83,7 +83,7 @@ int main() {
// We are starting with GPIO 2, our bitmap starts at bit 0 so shift to start at 2.
int32_t mask = bits[val] << FIRST_GPIO;

// Set all our GPIO's in one go!
// Set all our GPIOs in one go!
// If something else is using GPIO, we might want to use gpio_put_masked()
gpio_set_mask(mask);
sleep_ms(250);
Expand Down