Introduction: Lily∞Bot With Raspberry PI Pico W: Get Started Programming With MicroPython in Platform IO Visual Basic

About: I am a professor of electrical engineering and robotics, Open Source Hardware Trailblazer, and co-founder of Black In Engineering and Black in Robotics. @drcaberry and @noiresteminist on most socials . It will…

This story is a continuation of the Open-Source Flower∞Bots journey. In the latest version of the robot, it now has a modular bottom and top so that they can be changed as needed for the various brains, microcontrollers or microcomputers and also the necessary power for them. Modified from the following Shilleh's project and Youtube. This project describes how to get started with the Raspberry Pi Pico W attached to the Lily∞Bot to write programs and control outputs and read sensors to execute actions on the robot.

Supplies

Lily∞Bot from NoireSTEMinist.com/shop includes Raspberry PI Pico W,

or 3d printer and CAD files and code at https://github.com/berry123/Lily-Bot

Step 1: Install MicroPython on the Raspberry PI Pico W

  1. Download Visual Studio from this link
  2. Download Python from this link
  3. Download MicroPython from this link
  4. Install MicroPython on Pico W by plugging the device into your computer while holding down the BOOTSEL button
  5. The folder for the Pico W will open on your computer
  6. Drag the .UF2 document that downloaded with MicroPython into the open PICO W folder
  7. Unplug the PICO W from the computer and plug it back in WITHOUT holding the BOOTSEL button
  8. Open up Visual Studio on your computer and the bottom status should show the PICO connected to the computer
  9. Click on Extensions and do a search on MicroPico and install


Step 2: Run the Code

  1. Create a folder on your computer for the LilyBot code
  2. Open this folder inside of Visual Studio by using the file explorer button on top left of previous figure
  3. Then click on CTRL-SHIFT-P in Windows or COMMANd-SHIFT-P in Mac or Help->Show All Commands
  4. In the box at the top type MicroPico: Configure Project
  5. Create a Python file (.py) in the folder and copy the code in the following space in the document.
  6. Make sure that there are no errors and confirm that bottom status screen shows the Pico W connected.
  7. Next right click on the file and select "Run current file on Pico"




#CAB 9.14.23 buzzer.py
#blink internal LED on Raspberry PI Pico W on Lily∞Bot
#LED on pin 25
#https://www.noiresteminist.com/shop


from machine import Pin
from utime import sleep


pin = Pin("LED", Pin.OUT)


print("LED starts flashing...")
while True:
    pin.toggle()
    sleep(1) # sleep 1sec

  • f the green LED starts blinking, you are all set up and can go on to the next tutorial on blinking and external LED on the Lily∞Bot using Raspberry PI Pico W with MicroPython. If not, please walk through this tutorial again until you can get it working.


Step 3: Confirm It Works

  1. Watch the video to confirm your robot and code are working correctly.
  2. If it does not, try to debug and troubleshoot your code.
  3. See all Lily∞Bot materials on the GITHUB here.
  4. See all Lily∞Bot videos on the YouTube here. There are several different playlists including hardware, software and control.