Seeed xiao RP2040 doesn't seem to be working correctly with micropython

I am new to the community, thank you in advance for any help. I have a Seeed xiao that I have loaded with Micropython. the Blink test and the beautiful color test from seeed studio both seem to work properly. When I try to load a code into the xiao it works, but not correctly.
the code is very basic,

from machine import Pin

r = Pin(0, Pin.OUT) 
g = Pin(1, Pin.OUT) 
b = Pin(2, Pin.OUT) 

I load that code, then in the command lines try to toggle each pin on or off, using r.on() and r.off()
the problem is, for some reason on my xiao the pins aren’t in the right place. Pin 0, 1 and 2 don’t do anything, I trace it down with a multimeter and it’s pins 6, 7 and 8 that are toggling on and off. Has anyone experienced that before?
It works, but it is not working right, Is there some trick with Micropython and the xiao board that offsets the pins?

Hope someone has some experience with that.
Thanks
D

I’m using the Micropython for Raspberry Pi Pico distribution as mentioned in the Seeed XIAO RP2040 Wiki.

The mother lode for information is the Official “Get started with Micropython on Raspberry Pi Pico” document from the truly excellent folks at the Raspberry Pi organization.

The Seeed XIAO RP2040 does not have all of the pins (obviously), but the processor is the same and you use Micropython the same.

Anyhow, the Pin(xx,…) stuff uses CPU GPIO pin numbers.

I mean, Micropython for the Raspberry Pi Pico certainly doesn’t know anything about Arduino Pin designations for the XIAO RP2040, right?

On the XIAO RP2040, Pin 0 on the package (Arduino A0 or D0) is not GPIO pin 0; it’s 26.
Look at the XIAO RP2040 pinout, and you see the following correspondence:

Seeed XIAO RP2040 pins relative to RP2040 GPIO

        Arduino         RP2040 GPIO
          Pin               Pin
        ---------------------------
        A0/D0                26
        A1/D1                27
        A2/D2                28
        A3/D3                29
        SDA/D4                6
        SCL/D5                7
        Tx/D6                 0
        Rx/Csn/D7             1
        SCK/D8                2
        MISO/D9               4
        MOSI/D10              3

Bottom line:
Try the GPIO pin numbers in your Python script and see if it makes sense now.

Regards,

Dave

Dave,
Thank you so much for that information. I scanned the seeedstudio page quickly and brushed right over the correlation between the two. It is much clearer now.

Thanks!
D