Tutorial of R2P2
1-1 Getting start with R2P2
- Download the latest
R2P2-*.uf2from the releases page of the repository - Drag and drop it into the RPI-RP2 drive
- Open a proper port in your terminal emulator. See also terminal-emulator
1-2 R2P2 shell has some UNIX-like commands
- Try some UNIX-like commands like
ls,mkdirandtouch
1-3 R2P2 has PicoIRB
- Open PicoIRB with
irbcommand
2-1 LED blinking (L-chika) with PicoRuby
- Turn on the on-board LED using PicoIRB
- Note: If you use “Pico W” or “Pico 2 W”, use
led = CYW43::GPIO.new(CYW43::GPIO::LED_PIN).CYW43 must be initialized withCYW43.initin advance
2-2 require "adc" loads ADC class
- You can load pre-built libraries like “picoruby-adc” and use ADC class
3-1 PicoIRB has multi-line editor!
- That’s cool, right?
3-2 PicoRuby has Time class working with RTC in MCU
- The clock will be persistent if you connect a battery-driven RTC module. Try it :)
3-3 You can even use a Vim-like editor in R2P2
- It’s not for a serious usage but for demonstrating the viability of PicoRuby ;)
3-4 You can drag and drop your Ruby script from your laptop
NOTE: From PicoRuby version 3.4, this feature is no longer available. Use PicoRuby Web Terminal described in terminal-emulator instead.
- This is what you want to do in a real development
3-5 /home/app.rb automatically starts Pi Pico
- Now your Pi Pico is a stand-alone device