Expansion Board pin numbers vs LoPy pin numbers
-
Let me ask a naïve question, for which there is probably a very straightforward answer:
Why is the pin numbering on the expansion board (beginning with 'G') completely different from the pin numbering on the LoPy (beginning with 'P')? The expansion board numbers also are not mentioned on the newly published Pin-Out overview.
What am I missing?Thanks,
Jakko
-
I'm assuming it was done to provide backwards compatibility for the WiPy1 expansion board.
-
Thanks Xykon, that makes sense.
Is it then correct that both Pin('Px', ......) and Pin('Gx', .......) with x being the pin number, will be recognized by micropython?
-
@Jakko Yes
from machine import Pin p_out=Pin('G23',mode=Pin.OUT) p_out.id() 'P2' -
Yes, the G numbers are to match the WiPy 1 (version 2 uses ESP32 like the LoPy), and the WiPy 1 in turn got their order from the GPIO pin order on the CC3200 processor it uses. LoPy's support for the G numbering is fairly explicitly to keep the expansion board the same, as the P names are all under
machine.Pin.moduleand the G names are undermachine.Pin.exp_board. By the way, those locations hold preexisting instances of all the pins, so can be used to access the few that currently crash (like G3/P16). That's one bug I plan to chase down after source release.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login