Nebula Raiders (MicroPython)

I put the Arduino project on hold for a bit, while I broke out another project from Crafting Table (formerly inventr.io) that integrates the Raspberry Pi Pico WH. I’m heading towards another project (in future) with building a Raspberry Pi 5 system with AI board.

20251011 Basic setup steps:

Current Mac OS (10.13.6, MacOS High Sierra:

-This is where I’ll have some workarounds needed, because I remembered I needed to have Thonny version 4.1.4 (released 20231119), as the newer version doesn’t work on this MacOS. And, I can’t upgrade the MacOS because the hardware is circa 2011.

Firmware install:

-Downloaded the firmware from CraftingTable

-Held down BootSel button and plugged in the USB cable to Mac

-Dragged the firmware file over to the folder that appeared

-Had to unplug the cable and back in again, in order for Thonny to recognize the Raspberry Pi Pico

-MicroPython 1.26.1 (release 20250911)

Picozero library:

-Instructions say go (inside Thonny) to Tool, Manage Packages, and search for picozero

-That only returns something called Pickle, and not picozero by PyPy

Note: I read somewhere that this was fixed in the newest version of Thonny, but I can’t use that

-On crafting table, someone posted to go to https://pypi.org/project/picozero#files and download the picozero 0.4.2 file (picozero-0.4.2.tar.gz). Note: This version I’m also seeing on other sites.

NOTE: That didn’t work for me, as the .tar.gz. file wasn’t clickable (grayed out). Also, someone on boards posted an issue with having a Mac, and needing to go to Github to download the picozero.py file.

“Tools/Manage Packages… does not work for me. (Using a Mac) I downloaded picozero from github, saved the file as picozero.py, then went to View, clicked on Files, went searching for my new picozero.py file, right-clicked on it, and chose Upload to… It seemed to work. But I still can’t find picozero in Tools/Manage Packages.”

Referencing this for instructions:

https://picozero.readthedocs.io/en/latest/gettingstarted.html

Instructions like this annoy me – “Either clone the picozero GitHub repository or copy the code from the picozero.py file and save it on your main computer.”

-They don’t say how you clone something from GitHub…

From the list of repositories, click the repository you want to clone. To select the local directory into which you want to clone the repository, next to the “Local Path” field, click Choose… and navigate to the directory. At the bottom of the “Clone a Repository” window, click Clone.

How to clone a repository:

https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository

Terminal; went to a folder

git clone https://github.com/RaspberryPiFoundation/picozero.git

Well… that was a pain.

I think I resolved it by just focusing on the file ‘picozero.py’

There are instructions to open the folder and find the file for picozero.py (within Thonny); right click; upload. That places picozero.py within Thonny and you can write code that references the library.

Within Manage Packages, it still doesn’t show picozero.

Posted in Uncategorized | Leave a comment

Day 6 – Lost in Space

Photoresistor

With light, there is less resistance

Without light, there is more resistance

High resistance, semi-conductor material. When light hits the device it absorbs the light photons; this process provides energy to the electrons

Analog signals

Continuous signals

Digital signals

Discrete, and in one of two states – 0 or 1 (LOW or HIGH)

HERO Board

A0 – Analog Pin

Arduino Serial Monitor

Window where software can talk to microcontroller

Establish a serial communication connection between IDE and Board

Then, Tools, Serial Monitor (in IDE) to view the data from the board (Photoresistor output)

analogRead ();

Allows HERO board to read analog signals

Measure voltage from 0V to 1023 (5V)

We are “reading” information from photoresistors and “writing” to devices like LEDs

Posted in Uncategorized | Leave a comment

Day 4 – Lost in Space

PinMode (in Setup):

-Switches – input

-LEDs – output

// #define CABIN_LIGHTS_PIN 10 // pin controlling the cabin lights
// #define STORAGE_LIGHTS_PIN 11 // pin controlling the storage lights
// #define COCKPIT_LIGHTS_PIN 12 // pin controlling the exterior lights
const byte CABIN_LIGHTS_PIN = 10; // pin controlling the cabin lights
const byte STORAGE_LIGHTS_PIN = 11; // pin controlling the storage lights
const byte COCKPIT_LIGHTS_PIN = 12; // pin controlling the exterior lights

Note: In past, we used #define to set system-wide variables. Now we’re using const byte.

Const (Constant) – has to remain the same value

Posted in Uncategorized | Leave a comment