Raspberry Pi Pico (in Arduino) get board info, include pins assignment.

This simple code retrieve board info, include pre-defined pins assignment, for Raspberry Pi Pico (rp2040) in Arduino framewok.

pico_pins_info.ino

void setup() {
  delay(2000);
  Serial.begin(115200);
  delay(200);
  Serial.println("\n- Pico (rp2040) pins info -");
  Serial.println("-----------------------------");

  Serial.println("BOARD_NAME:\t\t" + String(BOARD_NAME));
  Serial.println("BOARD_VENDORID:\t\t" + String(BOARD_VENDORID, HEX));
  Serial.println("BOARD_PRODUCTID:\t" + String(BOARD_PRODUCTID,  HEX));
  Serial.println();
  
  Serial.println("LED_BUILTIN:\t" + String(LED_BUILTIN));
  Serial.println(":\t" + String());

  Serial.println("SPI_MOSI:\t" + String(SPI_MOSI));
  Serial.println("SPI_MISO:\t" + String(SPI_MISO));
  Serial.println("SPI_SCK:\t" + String(SPI_SCK));
  Serial.println();

  Serial.println("I2C_SDA:\t" + String(I2C_SDA));
  Serial.println("I2C_SCL:\t" + String(I2C_SCL));
  Serial.println();

  Serial.println("SERIAL1_TX:\t" + String(SERIAL1_TX));
  Serial.println("SERIAL1_RX:\t" + String(SERIAL1_RX));
  Serial.println();

  Serial.println("A0:\t" + String(A0));
  Serial.println("A1:\t" + String(A1));
  Serial.println("A2:\t" + String(A2));
  Serial.println("A3:\t" + String(A3));
  Serial.println();
  
}

void loop() {
  // put your main code here, to run repeatedly:

}


It's pre-defined in:
/home/pi/.arduino15/packages/arduino/hardware/mbed_rp2040/4.0.2/variants/RASPBERRY_PI_PICO/pins_arduino.h



Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator