Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days.
0

Default contents of Metro Express M0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Default contents of Metro Express M0

by HenryM on Sun Dec 05, 2021 11:20 pm

I've blown away the contents of my Metro Express M0 board. Can anyone point me to a where I can find the default contents so that I may begin experimenting again from the beginning?

Additionally, this page looks like it has libraries for Circuit Python 6 and 7. The example main.py suggests that my board is using 2.2.0. Do I need to figure out how to update it?

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Default contents of Metro Express M0

by HenryM on Mon Dec 06, 2021 12:07 am

I have a suspicion that I need to update to CP 7.0 from here: https://circuitpython.org/board/metro_m0_express/

I'll give this a shot in the morning.

Edit: No go... solid red neopixel. I think I just need to figure out what libraries are missing from the lib directory.

Edit 2: And the flash is mounting as read only. Yahoo. Probably a Linux thing, deal with it in the morning.

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Default contents of Metro Express M0

by HenryM on Mon Dec 06, 2021 11:17 am

The read only thing was resolved by running the following:
  1. sudo umount /media/henrym/CIRCUITPY
  2. sudo dosfsck /dev/sdc1 (after determining that my device was sdc1)

I've copied "neopixel.mpy" into /lib on the device and added the following code to main.py:

Code: Select all | TOGGLE FULL SIZE
import board
import neopixel

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixel.brightness = 0.1

def wheel(pos):
    # Input a value 0 to 255 to get a color value.
    # The colours are a transition r - g - b - back to r.
    if (pos < 0):
        return [0, 0, 0]
    if (pos > 255):
        return [0, 0, 0]
    if (pos < 85):
        return [int(pos * 3), int(255 - (pos*3)), 0]
    elif (pos < 170):
        pos -= 85
        return [int(255 - pos*3), 0, int(pos*3)]
    else:
        pos -= 170
        return [0, int(pos*3), int(255 - pos*3)]

i = 0
while True:
    pixel[0] = wheel(i)
    i = i + 1 if i < 255 else 0


The board is alive again.

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Please be positive and constructive with your questions and comments.