Articles Hierarchy

Articles Home » Arduino Projects » Arduino IDE 2.0 and RP2040

Arduino IDE 2.0 and RP2040

we come from
Arduino IDE 2.0 test on ESP ++

and from
Raspberry Pi PICO

and i want setup this new and reactivate my work with the raspberry Pi controller board RP2040
on a win 10 computer.



while i work on my
* win10 PC with Arduino IDE 2.0.0 for ESP32
* and on RPI4 have the Mosquitto 2 running
* and the ESP Power Meter
* * publish MQTT ( every 5 sec )
* * and serves web page with measuring data
i not want disturb running tests...


so i use a old win10 laptop for this here:


new setup means?
* delete ( the ZIP ) and UNZIP of a existing IDE
* if want use the old working sketchbook directory later again,
could there delete the /libraries, here
i ignore that and just work on IDE's default path.

* but most of all must delete:
C:\User\< username >\AppData\local\Arduino15
( that deletes like all the installed ESP tools ...)
and C:\User\< username >\.arduinoIDE
( that deletes the Preferences ...)

download newest version, here today
Arduino IDE 2.0.0 beta 11, ( NO, i do: )
https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-latest_Windows_64bit.zip
but its NIGHTLY version today from 2021/09/19/
UNZIP
find
Arduino IDE.exe
file and make a 'shortcut' from it,
and copy (drag drop) this shortcut to the 'Desktop' and there
rename it to "Arduino 200b11n" ( or even with date.. to be more exact )
so you are prepared to have several versions ready.
( i also still like the arduino 1.8.16 )

start it and wait for JAVA & firewall [Allow access]
now above 2 directories will be created new AND add
C:\User\< username >\Documents\Arduino\
as a new sketch book path.


now select from menu:
/Tools/Board/Boards Manager/
search for "RP2040"
Arduino Mbed OS RP2040 INSTALL (today 2.4.1 )
( get 2 times a security question [INSTALL] )

select:
/Tools/Board/ Raspberry Pi PICO


and not forget to adjust:
/File/Preference/Theme Dark (Theia)
and
/Edit/ increase Font Size


connect USB micro cable to RP2040
"Setting up Device" ... "Device is ready"
/Tools/Port/ select port
and UPLOAD the empty sketch
( my board was on CIRCUIT PI ( with emulated USB drive ) but that was reset with this empty upload )

now select
/File/Examples/01 Basics / Blink /
/File/save as /
make [new folder] "RP2040"
[enter] for save as "Blink' in
C:\User\< username >\Documents\Arduino\RP2040\Blink

upload and see the RP2040 board LED blinking
looks like we are ready now


i did quite some programming with the Raspberry IDE for the PICO
( and also play micro/circuit python ) but took a long break...
but i want cache up, while using now the Arduino IDE,
( if that is ready now for RP2040 controller ? )

the PICO has headers soldered already and on breadboard with

-a- DHT22 AM3202 module
( wire on GP7 )

-b- OLED SSD1306
( SDA GP8 , SCL GP9 )

like i show in the old article already



install library: ( and dependencies )
Adafruit SSD 1306 rev 2.4.6
DHT Sensor library rev 1.4.2




ok, it happened: i ?bricked? a RP2040
meaning after serial problems i could not upload sketch anymore

-a- disconnect USB PICO
-b- connect ( while press 'boot select' button )
and find the emulated drive

now can try again to upload sketch from arduino IDE OR:

-c- copy 'down' file flash_nuke.uf2
from flash_nuke.uf2
and it reboots.
-d- then download from arduino IDE a 'good' test code...
like BLINK with added
Serial.print("ON / OFF");
so we can open the serial Monitor and see text lines in sync with LED blink




ok, what i see first is THAT I SEE NOTHING...
problem is the serial printing ( like from setup ) is never visible...
( i remember Arduino LEONARDO )
also not after USB reconnect ( OUT / IN )
( in addition that RP2040 from Arduino IDE 2.0.0 NOT reboots on start Serial Monitor what most Arduino boards do )

now to see if anything is running i moved that part out of setup ( just init the COM )
and used a flag to run it from loop ( and with millis() > 2000 ) once.
now i see my info in Serial Monitor.

p.s. found in some sketch a delay(5000) after Serial.begin(...); in setup,
will try that later.



but not so lucky about the OLED,
problem is actually i never had this running..
and when i search internet i found mostly 'OLD' info and if it was using circuit python
well, why not ....
... it was a day later i was sure that the OLED display is ok see here

i first tested OLED on GP1 GP0 but later changed to GP5 GP4
as that is marked ( by color in pinout ) as DEFAULT hoping Arduino IDE sees that same.
BUT testing with 'ssd130_128x32_i2c' gives me nothing.
when i look:
https://github.com/earlephilhower/arduino-pico/blob/master/libraries/Wire/examples/TalkingToMyself/TalkingToMyself.ino
i see that:
Wire.setSDA(0);
Wire.setSCL(1);

but when i try from above adafruit code it does not work.
that is from:
c:\Users\< username >\Documents\Arduino\libraries\Adafruit_SSD1306\examples\ssd1306_128x32_i2c\
and refs to wire.h, where is that?
c:\Users\< username >\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\2.4.1\libraries\Wire\
and that is NOT the earlephilhower version?



INFO:
PinOut
and Arduino IDE specifics: Doc and GitHub
and extra SPI lib

the needed Arduino REFERENCE you get linked from IDE /Help/Reference