Raspberry Pi Pico Arduino core, for all RP2040 boards

Overview

Arduino-Pico Join the chat at https://gitter.im/arduino-pico/community

Raspberry Pi Pico Arduino core, for all RP2040 boards

This is a port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem.

It uses a custom toolset with GCC 10.2 and Newlib 4.0.0, not depending on system-installed prerequisites. https://github.com/earlephilhower/pico-quick-toolchain

There is automated discovery of boards in bootloader mode, so they show up in the IDE, and the upload command works using the Microsoft UF2 tool (included).

Installing via Arduino Boards Manager

Windows Users: Please do not use the Windows Store version of the actual Arduino application because it has issues detecting attached Pico boards. Use the "Windows ZIP" or plain "Windows" executable (EXE) download direct from https://arduino.cc. and allow it to install any device drivers it suggests. Otherwise the Pico board may not be detected. Also, if trying out the 2.0 beta Arduino please install the release 1.8 version beforehand to ensure needed device drivers are present. (See #20 for more details.)

Open up the Arduino IDE and go to File->Preferences.

In the dialog that pops up, enter the following URL in the "Additional Boards Manager URLs" field:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

image

Hit OK to close the dialog.

Go to Tools->Boards->Board Manager in the IDE

Type "pico" in the search box and select "Add":

image

Installing via GIT

To install via GIT (for latest and greatest versions):

mkdir -p ~/Arduino/hardware/pico
git clone https://github.com/earlephilhower/arduino-pico.git ~/Arduino/hardware/pico/rp2040
cd ~/Arduino/hardware/pico/rp2040
git submodule init
git submodule update
cd pico-sdk
git submodule init
git submodule update
cd ../tools
python3 ./get.py

Installing both Arduino and CMake

Tom's Hardware presented a very nice writeup on installing arduino-pico on both Windows and Linux, available at https://www.tomshardware.com/how-to/program-raspberry-pi-pico-with-arduino-ide

If you follow Les' step-by-step you will also have a fully functional CMake-based environment to build Pico apps on if you outgrow the Arduino ecosystem.

Uploading Sketches

To upload your first sketch, you will need to hold the BOOTSEL button down while plugging in the Pico to your computer. Then hit the upload button and the sketch should be transferred and start to run.

After the first upload, this should not be necessary as the arduino-pico core has auto-reset support. Select the appropriate serial port shown in the Arduino Tools->Port->Serial Port menu once (this setting will stick and does not need to be touched for multiple uploads). This selection allows the auto-reset tool to identify the proper device to reset. Them hit the upload button and your sketch should upload and run.

In some cases the Pico will encounter a hard hang and its USB port will not respond to the auto-reset request. Should this happen, just follow the initial procedure of holding the BOOTSEL button down while plugging in the Pico to enter the ROM bootloader.

Uploading with Picoprobe

If you have built a Raspberry Pi Picoprobe, you can use OpenOCD to handle your sketch uploads and for debugging with GDB.

Under Windows a local admin user should be able to access the Picoprobe port automatically, but under Linux udev must be told about the device and to allow normal users access.

To set up user-level access to Picoprobes on Ubuntu (and other OSes which use udev):

echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", GROUP="users", MODE="0666"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
sudo udevadm control --reload

The first line creates a file with the USB vendor and ID of the Picoprobe and tells UDEV to give users full access to it. The second causes udev to load this new rule. Note that you will need to unplug and re-plug in your device the first time you create this file, to allow udev to make the device node properly.

Once Picoprobe permissions are set up properly, then select the board "Raspberry Pi Pico (Picoprobe)" in the Tools menu and upload as normal.

Debugging with Picoprobe, OpenOCD, and GDB

The installed tools include a version of OpenOCD (in the pqt-openocd directory) and GDB (in the pqt-gcc directory). These may be used to run GDB in an interactive window as documented in the Pico Getting Started manuals from the Raspberry Pi Foundation.

Status of Port

Relatively stable and very functional, but bug reports and PRs always accepted.

  • digitalWrite/Read
  • shiftIn/Out
  • SPI master (tested using SdFat 2.0 https://github.com/greiman/SdFat ... note that the Pico voltage regulator can't reliably supply enough power for a SD Card so use external power, and adjust the USE_SIMPLE_LITTLE_ENDIAN define in src/sdfat.h to 0)
  • analogWrite/PWM
  • tone/noTone
  • Wire/I2C Master and Slave (tested using DS3231 https://github.com/rodan/ds3231)
  • EEPROM
  • USB Serial(ACM) w/automatic reboot-to-UF2 upload)
  • Hardware UART
  • Servo
  • Overclocking and underclocking from the menus
  • printf (i.e. debug) output over USB serial

The RP2040 PIO state machines (SMs) are used to generate jitter-free:

  • Servos
  • Tones

Todo

Some major features I want to add are:

  • Installable filesystem support (SD, LittleFS, etc.)
  • Updated debug infrastructure
  • I2S port from pico-extras

Tutorials from Across the Web

Here are some links to coverage and additional tutorials for using arduino-pico

Contributing

If you want to contribute or have bugfixes, drop me a note at [email protected] or open an issue/PR here.

-Earle F. Philhower, III [email protected]

Issues
  • Adafruit_ILI9341 does not compile

    Adafruit_ILI9341 does not compile

    Hi,

    I use Adafruit_ILI9341 to drive a 9341 LCD display in my Data General Nova simulator.

    https://github.com/marcelvanherk/nova1200-restoration (folder teensy_nova)

    I have successfully compiled this for the pico with your platform (with a few changes) but:

    #include "Adafruit_ILI9341.h"

    (latest version as well as dependencies) reports:

    C:\Users\marcel\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:53:10: fatal error: wiring_private.h: No such file or directory 53 | #include "wiring_private.h" | ^~~~~~~~~~~~~~~~~~ compilation terminated.

    could this be made to work on the pico?

    Marcel

    opened by marcelvanherk 55
  • Multicore crash with printf(%f)

    Multicore crash with printf(%f)

    Hi,

    i just switched over from the mbed Arduino core for the RP2040 because I'm pretty disappointed with how the code is written and maintained. Multicore is practically impossible to do there.

    I ran into a very weird behaviour with Printing to SerialUSB from both cores. I use propper Mutex and the weird thing is: it works when I use const char* or format but not when I call it with a const String&. then it just freezes after the first print

    here the code that easily reproduced the problem:

    
    #include "Arduino.h"
    
    
    mutex_t MUTEX_PRINT;
    
    //#define LOGFUNC Log // DOES WORK
    //#define LOGFUNC Log2 // DOES WORK
    #define LOGFUNC Log3 // DOES NOT WORK
    //#define LOGFUNC Log4 // DOES NOT WORK
    
    
    
    #include <stdarg.h>
    extern void Log(const char* format, ...) __attribute__((format(printf, 1, 2)));
    void Log(const char* format, ...)
    {
    	mutex_enter_blocking(&MUTEX_PRINT);
    
    	char loc_buf[64];
    	char* temp = loc_buf;
    	va_list arg;
    	va_list copy;
    	va_start(arg, format);
    	va_copy(copy, arg);
    	int len = vsnprintf(temp, sizeof(loc_buf), format, copy);
    	va_end(copy);
    	if (len < 0) {
    		va_end(arg);
    		return;
    	};
    	if (len >= sizeof(loc_buf)) {
    		temp = (char*)malloc(len + 1);
    		if (temp == NULL) {
    			va_end(arg);
    			return;
    		}
    		len = vsnprintf(temp, len + 1, format, arg);
    	}
    	va_end(arg);
    
    	
    	Serial.print("[");
    	Serial.print(millis());
    	Serial.print("] ");
    	Serial.println(temp);
    
    	
    
    	if (temp != loc_buf) {
    		free(temp);
    	}
    
    	mutex_exit(&MUTEX_PRINT);
    }
    
    void Log2(const char* msg)
    {
    	mutex_enter_blocking(&MUTEX_PRINT);
    	
    	Serial.print("[");
    	Serial.print(millis());
    	Serial.print("] ");
    	Serial.println(msg);
    	
    	mutex_exit(&MUTEX_PRINT);
    }
    
    
    void Log3(const String& msg)
    {
    	mutex_enter_blocking(&MUTEX_PRINT);
    	
    	Serial.print("[");
    	Serial.print(millis());
    	Serial.print("] ");
    	Serial.println(msg);
    	
    	mutex_exit(&MUTEX_PRINT);
    }
    
    
    void Log4(const String& msg)
    {
    	Log2(msg.c_str());
    }
    
    
    
    
    /*****************************************************/
    
    
    static bool start_done = false;
    
    void jtask0()
    {
    	mutex_init(&MUTEX_PRINT);
    	start_done = true;
    	
    	uint32_t loopcount = 0;
    	while(true)
    	{
    		loopcount++;
    
    		LOGFUNC("main0: loop");
    
    		delay(100);
    	}
    }
    
    void jtask1() 
    {
    	while(!start_done);
    
    	uint32_t loopcount = 0;
    	while(true)
    	{
    		loopcount++;
    		
    		LOGFUNC("main1: loop");
    
    		delay(100);
    	}
    }
    
    
    void setup() {
    	Serial.begin(115200);
    
    	while (!Serial.available()) 
    	{
    		Serial.print(".");
    		delay(1000);
    	}
    	while(Serial.available())
    		Serial.read();
    }
    
    void setup1() {
    	
    }
    
    void loop() {
    	jtask0();
    }
    
    void loop1() {
    	jtask1();
    }
    
    
    

    Could somebody try this? you can just switch between the Print Functions with the defines at the top.

    I'm trying to figure this out for half a day now and I can't I think I'm going crazy x]

    Thx

    Here the output of the working Prints:

    
    ..[9034] main0: loop
    [9034] main1: loop
    [9134] main0: loop
    [9134] main1: loop
    [9234] main0: loop
    [9234] main1: loop
    [9334] main0: loop
    [9334] main1: loop
    [9435] main0: loop
    [9435] main1: loop
    [9535] main0: loop
    [9535] main1: loop
    [9635] main0: loop
    [9635] main1: loop
    [9735] main0: loop
    [9735] main1: loop
    [9835] main0: loop
    [9835] main1: loop
    [9935] main0: loop
    [9935] main1: loop
    [10035] main0: loop
    [10035] main1: loop
    [10135] main0: loop
    [10135] main1: loop
    [10235] main0: loop
    
    

    and the not working

    
    ..[7003] main1: loop
    [7003] main1: loop
    [7103] main0: loop
    
    >>> DEADLOCK HERE <<< 
    
    

    Im using PlatformIO with this config

    
    [env:PICO_ALT_CORE]
    platform = https://github.com/maxgerhardt/platform-raspberrypi.git
    board = pico
    framework = arduino
    board_build.core = earlephilhower
    board_build.filesystem_size = 0.5m
    ; note that download link for toolchain is specific for OS. see https://github.com/earlephilhower/pico-quick-toolchain/releases.
    platform_packages =
        maxgerhardt/[email protected]://github.com/earlephilhower/arduino-pico.git
        maxgerhardt/[email protected]://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.arm-none-eabi-7855b0c.210706.zip
    
    
    opened by savejeff 50
  • Add Pico W WiFi support

    Add Pico W WiFi support

    Add support for the WiFi chip on the Pico W board.

    Works well enough for experimental use

    To Do: [X] Update LWIP options (now it is the default example one [X] Add WiFi class [X] Add WiFi client class [X] Add support classes (DNS, etc.) [X] Add WiFi server class [X] Add AP mode [X] Examples [X] Docs (such as they are...)

    • USB interrupt now no longer hard coded (conflicted with the WiFi IRQ).
    • Add in Pico W board to makeboards.py
    • Add in GPIO and variant support
    • Initialize WiFi in the Variant
    • Use manual LWIP, fix size accounting
    • Remove the SDK WiFi overrides
    • Pulling in work done in the ESP8266 core.
    • Make IPAddress support IPv6
    • Build LWIP with IPv4 and IPv6 support
    • Use proper MAC
    • Avoid cyw_warn crash. Make macro to a comment while building
    • Add WiFiServer
    • Add WiFiUdp
    • Move LWIP-specific support files to LWIP_Ethernet
    • Add WiFi::ping (ICMP ping)
    • Move ICMP echo (ping) to LWIPIntfDev
    • Move hostByName to LwipIntfDev
    • Add AP Mode

    Eventually... Fixes #666 Fixed #665

    opened by earlephilhower 41
  • USB Device not detected by host when using platformIO

    USB Device not detected by host when using platformIO

    Issue : Device is not detected by Host computer after uploading from platform io

    What I have tried

    • Many of the Adafruit TinyUSB library examples (HID,MIDI,.. none did work)
    • Compiling on 3 different computers (didn't help)
    • Including libraries or not in the platformio.ini file

    what works :

    • When compiled on PIO : The rest of the code seems to run fine, just not the USB part
    • When compiled on Arduino IDE : USB comunication works fine (everything works)

    Example code :

    #include <Arduino.h>
    #include <Adafruit_TinyUSB.h>
    #include <MIDI.h>
    
    Adafruit_USBD_MIDI usb_midi;
    MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI_USB);
    
    void setup(void) {
      TinyUSB_Device_Init(0);
    
      MIDI_USB.begin(MIDI_CHANNEL_OMNI);
      while( !TinyUSBDevice.mounted() ) delay(1); // obviously hangs there if not commented
    }
    
    void loop(){
    //device should be detected at this point
    };
    

    platformio.ini file :

    [env:pico_W64]
    platform = https://github.com/maxgerhardt/platform-raspberrypi.git
    board = pico
    framework = arduino
    board_build.core = earlephilhower
    board_build.filesystem_size = 0m
    platform_packages = 
    	maxgerhardt/[email protected]://github.com/earlephilhower/arduino-pico.git
    	maxgerhardt/[email protected]://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.arm-none-eabi-ed6d983.220212.zip
    build_flags = -DUSE_TINYUSB
    lib_deps = 
    	adafruit/Adafruit TinyUSB [email protected]^1.9.4; tried with and without
    

    Nalco

    platformio 
    opened by NalcoDesigns 32
  • Default pins for Serial/SPI/I2C not set properly

    Default pins for Serial/SPI/I2C not set properly

    I was having issues getting any i2c sensor to work so after a lot of testing and searching i came across this issue witch is unrelated but did help me https://github.com/earlephilhower/arduino-pico/issues/38#issuecomment-808835731 the tester that was pointed out also did not work.

    no i saw that PICO_DEFAULT_I2C_SCL_PIN and PICO_DEFAULT_I2C_SDA_PIN ar defined but when correctly connected it does not work.

    i fixed this by setting the pins at the beginring of my program Wire.setSCL(PICO_DEFAULT_I2C_SCL_PIN);//gp5 Wire.setSDA(PICO_DEFAULT_I2C_SDA_PIN);//gp4

    now i don't know if this is an issue but seeing that they are defined you would expect it to use them if not explicitly told to use different pins right? I figured i would let you know.

    bug 
    opened by PreciousRoy0 30
  • XIAO RP2040 failed @ Wire.write (I2C)

    XIAO RP2040 failed @ Wire.write (I2C)

    Discussed in https://github.com/earlephilhower/arduino-pico/discussions/591

    Originally posted by numeru55 May 23, 2022 Using both

    rp2040:rp2040    2.0.2   2.0.2  Raspberry Pi Pico/RP2040                  
    Seeeduino:rp2040 2.7.2   2.7.2  Seeed XIAO RP2040  
    

    I2C scan is OK for both core:

        Wire.beginTransmission(0x40);
        byte error = Wire.endTransmission();
    

    But Wire.write() is ignore only for earlephihower:

        Wire.beginTransmission(0x40);
        Wire.write(byte(0));
        byte error = Wire.endTransmission();
    

    Seeed core : address byte and 0 are transmitted normally earlephihower: nothing is transmitted on I2C line. Why?

    opened by numeru55 25
  • No more able to program my RP2040

    No more able to program my RP2040

    Hello,

    First of all a big thank you for your work.

    i'm actually no more able to program my RP2040. Can not be sure at 100% but seems to be since the update a few day ago.

    "Resetting COM10 Converting to uf2, output size: 114176, start address: 0x2000 Unable to build drive list Une erreur est survenue lors du transfert du croquis " if using the "Mbed version" it's ok but no more with yours. tried with 2 different board ans same result.

    Any advice on what to check ?

    regards

    Jean-Francois

    opened by jfl-207 24
  • EEPROM.commit() hangs apparently due to rp2040.idleOtherCore() / rp2040.resumeOtherCore()

    EEPROM.commit() hangs apparently due to rp2040.idleOtherCore() / rp2040.resumeOtherCore()

    I am having a problem with EEPROM.commit() hanging randomly. Sometimes it works, mostly it doesn't. Be aware that I am also using FreeRTOS and using the PlatformIO environment. See example code below.

    In the following code I use EEPROM.end(), but the failure is happening within EEPROM.commit() (called within end())

    I have tried various things including running saveConfig() in a separate task running at highest priority, placing vTaskDelay() between calls to EEPROM methods and stepping through/over using the debugger (via picoprobe). Note: it runs fine if I step through it. So maybe there's a timing issue.

    I finally tried editing EEPROMClass::commit() to; ... noInterrupts(); // rp2040.idleOtherCore(); flash_range_erase((intptr_t)_sector - (intptr_t)XIP_BASE, 4096); flash_range_program((intptr_t)_sector - (intptr_t)XIP_BASE, _data, _size); // rp2040.resumeOtherCore(); interrupts(); ...

    Success! So it seems the problem is in idleOtherCore() / resumeOtherCore() Thankfully I have no tasks running on the other core - maybe I should, to keep this happy?


    #define EEPROM_SIZE 255 #define EEPROM_ADDRESS 0

    typedef long signed int MotorPosition_t;

    struct Config { short configured; MotorPosition_t motorPosition; MotorPosition_t openedPosition; };

    void saveConfig(MotorPosition_t motorPosition, MotorPosition_t openedPosition) { Config config; config.configured = ConfigMagicNumber; config.motorPosition = motorPosition; config.openedPosition = openedPosition;

    EEPROM.begin(EEPROM_SIZE); EEPROM.put(EEPROM_ADDRESS , config); EEPROM.end(); }

    freertos 
    opened by ozbotics 22
  • TinyUSB Web Serial is partially broken

    TinyUSB Web Serial is partially broken

    When using PlatfomIO and the latest RP2040 core/packages WebUSB now shows up in the browser but is painfully slow and much slower than when using the ArduinoIDE.

    Code is taken from the Adafruit web usb serial example and modified for PlatformIO https://github.com/zjwhitehead/PIO-WebUSB-Testing

    • Note: I tried setting -O3 and similar flags but I get the same results.
    • Cant tell if its related to https://github.com/earlephilhower/arduino-pico/issues/630

    Hopefully this is the right repo for the issue, and its easily reproducible for others.

    There should be a new line after each heartbeat. Also not seen here is that theres ~1 second delay between new words appearing on PIO and only ~200ms (aka the delay) for Arduino. Heres what it looks like when running the platform via Aruduino IDE image And here is when running the same code via PlatformIO

    image

    opened by zjwhitehead 21
  • Need new pico-sdk with fixed configuration for Adafruit Feather, custom boot2 and libpico

    Need new pico-sdk with fixed configuration for Adafruit Feather, custom boot2 and libpico

    Hi,

    I would appreciate if you'll support Adafruit Feather RP2040 which has 8MB flash. I've found in the code where it says that the pico has only 2048k flash, but I don't know if changing this to 8096k will make it work.

    Thanks Yoram

    help wanted 
    opened by yoramrotbach 21
  • lwip included on Pi Pico (without W) ?

    lwip included on Pi Pico (without W) ?

    With Core Version 2.3.3 i get a lot of redefinition warnings due to some defines from lwip that collide with our knx stack.

    10 | #define htons(x) ( (getbyte(x,0)<<8) | getbyte(x,1) ) | In file included from c:\users\dosp\appdata\local\arduino15\packages\rp2040\hardware\rp2040\2.3.3\pico-sdk\lib\lwip\src\include\lwip\ip_addr.h:41, from C:\Users\dosp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\2.3.3\cores\rp2040/api/IPAddress.h:27, from C:\Users\dosp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\2.3.3\cores\rp2040/api/ArduinoAPI.h:30, from C:\Users\dosp\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\2.3.3\cores\rp2040/Arduino.h:28, from d:\Data\Eigene Dokumente\Projekte\EIB\OpenKNX\SirSydom-Repos\SEN-UP1-8xTH\software\SNS-8xTH.P1\src\extlibs\knx\knx\bits.h:29, from d:\Data\Eigene Dokumente\Projekte\EIB\OpenKNX\SirSydom-Repos\SEN-UP1-8xTH\software\SNS-8xTH.P1\src\extlibs\knx\knx\transport_layer.cpp:7:

    but I wonder why lwip is included because I did not select Pi Pico W and I did not include <WiFi.h>

    opened by SirSydom 19
  • After flashing the pico, no life sign from the board

    After flashing the pico, no life sign from the board

    Hi everyone,

    i'm using a RP2040-Zero from waveshare https://www.waveshare.com/product/raspberry-pi/boards-kits/raspberry-pi-pico-cat/rp2040-zero.htm.

    If i try to upload the code, even a simple "hello word" over serialUSB, nothing happens after the flashing is completed. It's like the board is not able boot or something because if i connect it over USB windows does not detect it and the code seems not running (tried to change a pin digital output to see if was something only related to the serialUSB but no changes there).

    If i use platformio indicated platform (raspberry) even if it is missing a lot of key stuff that are present in the arduino-pico, the board is detected overt serial and i get the "hello word" print. So the board is ok and working from the hw point of view.

    What am i doing wrong?

    This is my platformio.ini file

    [env:pico] platform = https://github.com/maxgerhardt/platform-raspberrypi.git board = pico framework = arduino board_build.core = earlephilhower

    thanks in advance

    opened by HexRebuilt 1
  • WiFiNINA FirmwareUpdater

    WiFiNINA FirmwareUpdater

    Hi

    trying to use the example of FimwareUpdater for WiFiNINA I have the following error, it seems with the Serial3 port, I have tried to declare it but I get an error

    arduino15/packages/rp2040/hardware/rp2040/2.3.3/variants/arduino_nano_connect/pins_arduino.h:94:21: error: 'Serial3' was not declared in this scope; did you mean 'Serial2'?
       94 | #define SerialNina  Serial3
          |                     ^~~~~~~
    /Arduino/libraries/WiFiNINA/examples/Tools/FirmwareUpdater/ESP32BootROM.cpp:335:32: note: in expansion of macro 'SerialNina'
      335 | ESP32BootROMClass ESP32BootROM(SerialNina, NINA_GPIO0, NINA_RESETN);
    

    Thanks

    opened by sabas1080 0
  • The 'softwire' library file cannot be used.

    The 'softwire' library file cannot be used.

    Problem: I use mpu6050 sensor and raspberry pie Pico development board. I can make sure the wiring is correct. However, the same code can run on Arduino uno and esp32, and can correctly read mpu6050 data. After the raspberry pie Pico runs, it cannot correctly read data.(Raspberry pie enables Pico to read normally using hardware IIC.)

    SoftWire Library: https://github.com/stevemarple/SoftWire

    SDK Version:2.2.2 and 2.3.3 have been tested.

    Picture: image Raspberry pie Pico failed to read with software IIC: image Arduino uno successfully read with software IIC: image

    Code:

    #include <SoftWire.h> SoftWire Wire(12, 13); // Raspberry pie Pico(SDA=12,SCL=13) ,ARDUINO UNO(SDA=2,SCL=3)

    const int MPU6050_addr = 0x68; int16_t AccX, AccY, AccZ, Temp, GyroX, GyroY, GyroZ; uint8_t swTxBuffer[32]; uint8_t swRxBuffer[32];

    void setup() { Wire.setTxBuffer(swTxBuffer, sizeof(swTxBuffer)); Wire.setRxBuffer(swRxBuffer, sizeof(swRxBuffer)); Wire.begin(); Wire.beginTransmission(MPU6050_addr); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true); Serial.begin(9600); }

    void loop() { Wire.beginTransmission(MPU6050_addr); Wire.write(0x3B); Wire.endTransmission(false); Wire.requestFrom(MPU6050_addr, 14, true); AccX = Wire.read() << 8 | Wire.read(); AccY = Wire.read() << 8 | Wire.read(); AccZ = Wire.read() << 8 | Wire.read(); Temp = Wire.read() << 8 | Wire.read(); GyroX = Wire.read() << 8 | Wire.read(); GyroY = Wire.read() << 8 | Wire.read(); GyroZ = Wire.read() << 8 | Wire.read();

    Serial.print("AccX = "); Serial.print(AccX); Serial.print(" || AccY = "); Serial.print(AccY); Serial.print(" || AccZ = "); Serial.print(AccZ); Serial.print(" || GyroX = "); Serial.print(GyroX); Serial.print(" || GyroY = "); Serial.print(GyroY); Serial.print(" || GyroZ = "); Serial.print(GyroZ); Serial.print(" || Temp = "); Serial.println(Temp / 340.00 + 36.53); delay(500); }

    waiting for feedback 
    opened by xiezhoubin 1
  • NRF24 radio problem using arduino-pico

    NRF24 radio problem using arduino-pico

    I ran into a problem with using Arduino-Pico and RF24 radio library. I was using some code I developed using Arduino-mbed under platformIO that works fine for the target Arduino Nano RP2040 Connect board and nrf24 hardware. The code compiles fine under Arduino-Pico but it seems like the pin settings for CE and CSN may not be getting set correctly when instantiating the radio object? Source code:

    // TARGET BOARD: Arduino Nano RP2040 Connect // RF24 library version: 1.4.5 #include <Arduino.h> #include <SPI.h> #include "printf.h" #include "RF24.h"

    // instantiate an object for the nRF24L01 transceiver RF24 radio(9, 10); // use pin 9 for the CE pin, and pin 10 for the CSN pin

    void setup() { // put your setup code here, to run once: Serial.begin(115200); while (!Serial) { // wait to ensure access to serial over USB }

    // initialize NRF24 transceiver on the SPI bus if (!radio.begin()) { while (1) { Serial.println(F(">> radio NOT FOUND on SPI bus!")); } // hold in infinite loop }

    }

    void loop() { // put your main code here, to run repeatedly: Serial.println(F(">> radio hardware found on SPI bus!!")); }

    waiting for feedback 
    opened by etrofla 5
  • Initial work for enabling IPv6

    Initial work for enabling IPv6

    This brings IPv6 up to the point where

    • Link local address is configured
    • Router Solicitation is sent
    • Router Advertizement is received and used to configure IP addresses
    • Neighbor Solicitation and Advertizement between the WiFi AP and the Pico happens
    • DHCPv6 is queried for DNS server
    • Multicast Listener Report is sent (mld6)
    • [x] Neighbor Solicitation requests are not received by the LWIP stack for some reason. This results in nothing working (IPv6 equivalent of arp request)
    • [x] Pinging the IPv6 addresses from a computer on the network does not work, due to the above issue

    Not working:

    • [ ] Sending multicast packet to [ff18::554b:4841:536e:6574:1]:20750 results in :ust rc=-6 (Illegal value) Udp. beginPacketMulticast, write, endPacket
    opened by oddstr13 6
Releases(2.3.3)
Owner
Earle F. Philhower, III
Earle F. Philhower, III
built-in CMSIS-DAP debugger tailored especially for the RP2040 “Raspberry Pi Pico”

RP2040 has two ARM Cortex-M0+ cores, and the second core normally remains dormant. pico-debug runs on one core in a RP2040 and provides a USB CMSIS-DAP interface to debug the other core. No hardware is added; it is as if there were a virtual debug pod built-in.

null 210 Aug 5, 2022
Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡

pico-lorawan Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board using a Semtech SX1276 radio module. Based on the Semte

Sandeep Mistry 68 Jul 25, 2022
#PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit

PICOmputer #PICOmputer - World first Raspberry RP2040 PICO - QWERTY & IPS devkit https://www.pcbway.com/project/shareproject/_PICOmputer____World_firs

Peter Misenko 46 Jul 6, 2022
Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

pico-microphone Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. ?? Hardware RP2040 board Raspberry Pi Pico Microp

Sandeep Mistry 107 Jul 31, 2022
USB host implementation using PIO of raspberry pi pico (RP2040).

Pico-PIO-USB USB host implementation using PIO of raspberry pi pico (RP2040). You can add additional USB port to RP2040. ?? This library is WIP. API m

null 572 Aug 11, 2022
This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip.

Pico SPI Utilities This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip. While th

Two Bean Development 2 Aug 7, 2022
Tetris on a Raspberry Pi Pico mounted on a Pimoroni Pico Explorer

PicoTetris Classic Tetris game running on a Raspberry Pi Pico microcontroller. Pico C port by Richard Birkby Original JavaScript implementation - Jake

Richard Birkby 32 Jul 27, 2022
Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack

breakout_rpi_pico Breakout game for Raspberry Pi Pico with Pimoroni Pico Display pack Prebuilt binary (breakout.uf2) is here. To build your own binary

null 18 Jan 17, 2022
Pico-uart-bridge - Raspberry Pi Pico UART-USB bridge

Raspberry Pi Pico USB-UART Bridge This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave lik

Álvaro Fernández Rojas 118 Aug 5, 2022
Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display

pico-display-matrix Digital rain animation gif with glow squeezed into a raspberry pi pico and pimoroni pico-display or how to actually use all Flash

null 30 Jul 17, 2022
A C library for RP2040-powered boards to control LCDs via the I2C protocol

picoi2clcd A C library to control I2C LCD displays using the Rapsberry Pi Pico (or really any board using the RP2040 microcontroller). License All of

Kosmas Raptis 2 Oct 16, 2021
Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5"

Raspberry-PI-PICO-display-RPI35 Prueba del Raspberry PI PICO con un display Raspberry PI TFT 3.5" Con ayuda de la libreria https://github.com/khoih-pr

null 1 Nov 10, 2021
Arduino core for GD32 devices, community developed, based on original GigaDevice's core

GD32 Arduino Core (New) This is a Arduino core is based off of the original GigaDevice core that was provided by the company in early June 2021 (see h

null 37 Jul 20, 2022
Internet of things created using arduino IoT cloud, consisting of esp and arduino boards

Internet of things created using arduino IoT cloud, consisting of esp and arduino boards. Goal of the project is to create a 3D printed RFID protected (with PIN) lock, including surveillance.

null 2 May 11, 2022
Using a RP2040 Pico as a basic logic analyzer, exporting CSV data to read in sigrok / Pulseview

rp2040-logic-analyzer This project modified the PIO logic analyzer example that that was part of the Raspberry Pi Pico examples. The example now allow

Mark 52 Aug 4, 2022
I add my Pi Pico (RP2040) stuff here.

Pico Stuff I add my Pi Pico (RP2040) stuff here. There are complete apps and libraries for sensors or complicated tasks. Libraries BMP180: Header-only

Luigi Cruz 97 Jul 13, 2022
uSDR implementation based on a RP2040 Pi Pico

uSDR-pico A uSDR implementation based on a RP2040 Pi Pico. This code is experimental, intended to investigate how the HW and SDK work with an applicat

null 79 Aug 12, 2022
This is some utility functions/classes for having a nice way to communicate with a pico board RP2040

PicoScreenTerminal This is some utility functions/classes for having a nice way to communicate with a pico board RP2040 How to build First follow the

GuillaumeG. 4 Nov 15, 2021
RPi Pico/RP2040 firmware for the Scoppy Oscilloscope

scoppy-pico RPi Pico/RP2040 firmware for the Scoppy Oscilloscope Installation and getting started instructions Scoppy Android app - Play Store Scoppy

null 43 Aug 9, 2022