RP2040 mikroBUS™ Development Board Hookup Guide

Pages
Contributors: santaimpersonator, MAKIN-STUFF
Favorited Favorite 0

Arduino Example

Note: The example for this tutorial assumes users have the latest version of the Arduino IDE installed. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide:

Installing an Arduino Library

January 11, 2013

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

For this example, users will need a USB-C cable, a RP2040 mikroBUS development board, a Weather Click, and access to a computer with the Arduino IDE installed.

USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$5.50
4
SparkFun RP2040 mikroBUS Development Board

SparkFun RP2040 mikroBUS Development Board

DEV-18721
$14.95

MIKROE Weather Click

SEN-18823
Retired

Hardware assembly is straight forward, insert the Click board into the mikroBUS socket and then connect the RP2040 development board to the computer in BOOTSEL mode.

Attach click board
The Weather Click inserted into the mikroBUS™ socket of the RP2040 development board. (Click to enlarge)

On the computer, users should have the MBed OS RP2040 Arduino core installed through the Board Manager. The Weather Click utilizes the BME280 PTH sensor; therefore, users will need to install a compatible Arduino library in the Arduino IDE. We recommend the SparkFun BME280 Arduino Library.

arduino library
The SparkFun BME280 Arduino Library in the library manager. (Click to enlarge)

Once installed, users will have access to basic examples for the sensor. The examples can be found under the File > Examples > SparkFun BME280 menu options. We recommend trying the Example1_BasicReadings sketch first. Users will need to modify the sketch in the setup() loop for it to function properly:

language:c
Serial.begin(115200);


while (!Serial){
    ; // wait for serial port
}

// Set I2C address
mySensor.settings.I2CAddress = 0x76;


Serial.println("Reading basic values from BME280");
  • The while statement allows the RP2040 to sync properly with a terminal emulator
  • The default I2C address of the library is 0x77; however, it must be changed to the address configured on the Weather Click

Once these changes have been made, users can upload the program. After the upload process has completed, users can open the Serial Monitor to see the sensor data:

example_demo
Uploading the example sketch to the RP2040 mikroBUS™ development board and the Weather Click sensor's data displayed in the Serial Monitor. (Click to enlarge)