Make your Adafruit CLUE multi-functional by adding a nifty startup menu to select the program you want to run. You no longer need to rename your files to code or main to run them. Simply drag and drop your files into your CIRCUITPY drive and this menu program does the rest.
This library depends on:
Follow Adafruit's CLUE Overview instructions under CircuitPython on CLUE. During the installation process, you will download the latest library bundle and transfer several libraries to the CLUE, including the Adafruit_CircuitPython_CLUE. If you are using this with the ElecFreak's micro:bit Smart Cutebot then follow the installation directions provided in the CircuitPython_CLUE_Cutebot repository.
Download this repository and copy main.py and at least one of the following files over to your CIRCUITPY drive.
file | description |
---|---|
menu.py | Original Python file and is highly detailed |
menu.mpy | Precompiled Python file and a third the size of menu.py |
menu_lite.py | Editable Python file and less than half the size of menu.py |
menu_cubot.mpy | Precompiled Python file for use with CircuitPython_CLUE_Cutebot v.2.0 repository |
If you are not using menu.py or menu.mpy then you will need to edit main.py. main.py is a simple redirect script and it is a lot easier than constantly renaming files. Open main.py and you will see:
#Uncomment the version you are using and comment out the rest.
import menu
#import menu_lite
#import menu_cutebot
If you are using menu_lite then change it to:
#Uncomment the version you are using and comment out the rest.
#import menu
import menu_lite
#import menu_cutebot
If you wanted to run another program at startup, for example hello_world.txt, it would be:
#import menu
#import menu_lite
#import menu_cutebot
import hello_world
It is that easy. I only change main.py when I am debugging a new program.
This menu program has two display modes: small and large text modes. The program will automatically start in large text mode. During boot up of the menu program you will be given a chance to press the A button to switch to small text mode.
Once the menu opens you can press:
Button | Action |
---|---|
A | Select next file |
B | Run selected file |
A and B | Show terminal, while pressed |
The code of the repository is made available under the terms of the MIT license. See license.md for more information.