Playing Pico W With Arduino IDE
This instructables show some projects you can play with your newly arrived Raspberry Pi Pico W with Arduino IDE.
Note:
There are much resources in Python platform that can be reused by Pico W but will not mentioned here. This instructables is mainly focus on Arduino IDE.
Supplies
- Raspberry Pi Pico W
- A display module, e.g. ILI9341, ST7789...
- breadboard and wires
What Is Raspberry Pi Pico W?
Raspberry Pi Pico W is a new product release at 2022 June. It added a WiFi module on top of a RP2040 microcontroller and make it become a new member of IoT maker board.
There are already various projects made from RP2040 since 2021 January launched. This instructables focus on what further can play after added a WiFi module.
https://www.raspberrypi.com/news/raspberry-pi-pico-w-your-6-iot-platform/
Software Preparation
Arduino IDE
Download and install Arduino IDE latest 1.x version if not yet:
https://www.arduino.cc/en/software
Arduino-Pico
Follow installation step to add Arduino-Pico support if not yet:
https://github.com/earlephilhower/arduino-pico
Arduino_GFX Library
Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "GFX for various displays" and press "install" button.
You may refer my previous instructables for more information about Arduino_GFX.
HttpClient Library
Arduino-Pico not yet implement it's own HttpClient library, but it can reuse previous written Arduino Library.
Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "WiFi HttpClient" and press "install" button.
JPEGDEC Library
Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "JPEGDEC" and press "install" button.
U8g2 Library
Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "U8g2" and press "install" button.
ArduinoVNC Library
This project use a enhanced version ArduinoVNC Library, you need import this library manually.
Download and import the ArduinoVNC library to Arduino IDE:
https://github.com/moononournation/arduinoVNC.git
You may refer to Arduino Documentation for the details on how to import library to Arduino IDE
Connect Display Module
The Pico W pinout is as same as Pico, so it is painless reuse all the software and hardware designed.
Here are the connection summary:
Raspberry Pi Pico W -> ILI9341
Vin -> Vcc
GND -> GND
GPIO 17 -> CS
GPIO 26 -> RESET
GPIO 27 -> D/C
GPIO 19(MOSI) -> SDI(MOSI)
GPIO 18(SCK) -> SCK
GPIO 28 -> LED
Ref.:
https://www.instructables.com/ArduinoGFX/
WiFi Analyzer
WiFi Analyzer can visualize the WiFi AP information in the environment.
This WiFi Analyzer is started from ESP8266 at 2017, then ported to ESP32 and RTL8720DN and became a Arduino_GFX example. Now it is also ported to Pico W.
You can find this example code at:
Arduino IDE -> File menu -> Examples -> GFX library for Arduino -> WiFi Analyzer -> PicoWiFiAnalyzer
Or you can select PicoWiFiAnalyzerUTF8 if you want to show Unicode AP name.
Ref.:
https://www.instructables.com/ESP8266-WiFi-Analyzer/
https://www.instructables.com/Portable-WiFi-Analyzer/
https://www.instructables.com/Dual-Band-WiFi-Analyzer/
RSS Reader
RSS Reader can display realtime RSS feed from the Internet.
The default RSS source is Hong Kong weather feed from Hong Kong Observatory, you can change your own feed by altering value of RSS_* definition.
You can find this example code at:
Arduino IDE -> File menu -> Examples -> GFX library for Arduino -> U8g2Font -> U8g2RssReader
Ref.:
https://www.instructables.com/Display-Unicode-in-Arduino/
WiFi Photo Frame
WiFi Photo Frame can display photo from a given URL in every time interval.
You can find this example code at:
Arduino IDE -> File menu -> Examples -> GFX library for Arduino -> WiFiPhotoFrame
Ref.:
https://www.instructables.com/Face-Aware-OSD-Photo-Frame/
VNC Client
ArduinoVNC can make your Pico W as a VNC client.
if you do not have a VNC server host yet, you may make a quick one with docker:
docker run -p 5901:5901 -e VNC_COL_DEPTH=16 -e VNC_RESOLUTION=320x240 -e VNC_PW=PleaseInputYourPasswordHere --shm-size=256m accetto/ubuntu-vnc-xfce-firefox-g3
You can find this example code at:
Arduino IDE -> File menu -> Examples -> GFX library for Arduino -> ArduinoVNC
Ref.:
https://github.com/accetto/ubuntu-vnc-xfce-g3.git
And More...
Still many of my previous IoT project that can port to Pico W, e.g.:
- Google Photo Frame
- BiJin ToKei
- MJPEG Video Streaming
- WiFi Remote Robot Car
- Robot Cat
- ...
The porting is still work in progress, this instructables will be updated afterward.