-
Notifications
You must be signed in to change notification settings - Fork 968
bus_scan.c example - fix pin number in comment #146
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
Conversation
The comment in the code is incorrect. I tested this out, and it doesn't detect the device via those pins. I was searching and found this comment thread: https://www.raspberrypi.org/forums/viewtopic.php?p=1822258&sid=1ff96911779abcedda7b3ae535d1d0af#p1822258 Sure enough, when I switched to pins 6 and 7, the code worked fine and could detect the device I had plugged into the i2c bus.
|
The comment is correct, it's referring to the GPIO numbers, and the "default I2C pins" are defined in https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h You seem to be confusing "GPIO numbers" with "physical pins" - see the diagram at https://www.raspberrypi.org/documentation/rp2040/getting-started/#board-specifications |
|
Great. I wasn't the first person to be confused by that, and wouldn't be the last. Prefixing GPIO numbers with GP would remove any ambiguity about what the number means and match the pinout diagram (https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf). |
|
I've updated based on your suggestion. |
|
@lurch Can you approve this so that Github actually thinks its approved? Or don't you have write access? @kilograham? |
|
Done @JamesH65 |
|
Feel free to merge |
IIRC the only Pico-related repo I have write access to is |
The base branch was changed.
The comment in the code is incorrect. I tested this out, and it doesn't detect the device via those pins.
I was searching and found this comment thread: https://www.raspberrypi.org/forums/viewtopic.php?p=1822258&sid=1ff96911779abcedda7b3ae535d1d0af#p1822258
Sure enough, when I switched to pins 6 and 7, the code worked fine and could detect the device I had plugged into the i2c bus.
Example wiring.