Official Raspberry Pi Pico Support Added to Arduino IDE

Arduino vs Pico
(Image credit: Tom's Hardware)

In a recent tweet from the official Arduino account, support for the Raspberry Pi Pico's RP2040 SoC has been officially added to the Arduino IDE. This is just a few weeks after a community project released its own package offering the Arduino IDE for RP2040 boards.

TOPICS
Les Pounder
Associate Editor

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • softeky
    I ported one of my "Community Project" Arduino IDE Raspberry Pico (RP2040) sketches to the Official (2.0 Beta), MacOSX-hosted Arduino IDE.

    It mostly worked, noting that varargs is treated differently within the two different ARM C compilers. "Community Project" implements VA_OPT(,) where "2.0 Beta" uses ##VA_ARGS (gcc cludge).

    In more detail: #if defined(RASPBERRY_PICO) /* printf macro messes up one-line if statements (with no section brackets) that use an else. */
    # define MAXMSGLINE 1000
    # if !defined(MACOSX)
    # define printf(format, ...) { char msg; sprintf(msg, format __VA_OPT__(,) __VA_ARGS__); Serial.print(msg); }
    # else /* !defined(MACOSX) */
    # define printf(format, ...) { char msg; sprintf(msg, format, ##__VA_ARGS__); Serial.print(msg); }
    # endif /* !defined(MACOSX) */
    #endif /* defined(RASPBERRY_PICO) */

    More importantly though (burying the lede), reading analog pin data using "analogRead()" in "2.0 Beta", by default, masks off the top two, most significant, bits (returning 10 bits instead of 12). It is necessary to call: analogReadResolution(12);to get sensible analog pin readings off the board.
    Reply