Skip to content

Commit 6d482ee

Browse files
Blargiancpq
authored andcommitted
Update README.md
Update wording
1 parent b333b73 commit 6d482ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,13 +1776,13 @@ uint16_t pin2 = PIN('G', 11); // G11 - GPIOG pin 11
17761776
17771777
Let's look first at what happens for `PIN('A', 3)`:
17781778
1779-
- `(bank) - 'A'` results in `'A' - 'A'` which equals ``. As a 16 bit binary value this would be `0b00000000,00000000`.
1779+
- `(bank) - 'A'` results in `'A' - 'A'` which will evaluate to `0`. As a 16 bit binary value this would be `0b00000000,00000000`.
17801780
- Next we bit shift this value left by 8 bits because we want to store `bank` in the upper byte of this 16 bit, or 2 byte value. In this case the result remains the same: `0b00000000,00000000`.
17811781
- Finally we bitwise OR the value above with `num`, in our case `3` which has a 16 bit binary representation of `0b00000000,00000011`. The result in binary is `0b00000000,00000011`
17821782
17831783
Let's take a look at what happens for `PIN('G',11)`
17841784
1785-
- `(bank) - 'G'` results in `'G' - 'A'` which equals `6`. As a 16 bit binary value this would be `0b00000000,00000110`.
1785+
- `(bank) - 'G'` results in `'G' - 'A'` which will evaluate to `6`. As a 16 bit binary value this would be `0b00000000,00000110`.
17861786
- Next we bit shift this value left by 8 bits because we want to store `bank` in the upper byte of this 16 bit, or 2 byte value. This results in a binary value of: `0b00000110,00000000`.
17871787
- Finally we bitwise OR the value above with `num`, in our case `11` which has a 16 bit binary representation of `0b00000000,00001011`. The result of the bitwise OR in binary is `0b00000110,00001011` which is a combination of `bank` in the upper byte and `pin` in the lower byte.
17881788

0 commit comments

Comments
 (0)