-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
568 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
[submodule "software/libraries/MicroPython-SSD1306"] | ||
path = software/libraries/MicroPython-SSD1306 | ||
url = https://github.com/TimHanewich/MicroPython-SSD1306 | ||
[submodule "i2c_proto_petal_tutorial/pico_ch32v003_prog"] | ||
path = i2c_proto_petal_tutorial/pico_ch32v003_prog | ||
url = [email protected]:hexagon5un/pico_ch32v003_prog.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Submodule pico_ch32v003_prog
added at
b27aed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
# Mount Pico and copy firmware file | ||
|
||
FIRMWARE=./supercon_image.uf2 | ||
|
||
# Function to execute on new device | ||
new_device () | ||
{ | ||
# First save the device to variable | ||
DEVICE=$(echo $1 | cut -d'/' -f3) | ||
|
||
# Notify user | ||
#echo "Found Device: $DEVICE" | ||
|
||
# Create mount point if it doesn't exist | ||
mkdir -p /mnt/$DEVICE | ||
|
||
# Mount device | ||
mount /dev/$DEVICE /mnt/$DEVICE | ||
|
||
# Copy firmware | ||
cp $FIRMWARE /mnt/$DEVICE/ | ||
|
||
# Attempt unmount to force write | ||
echo -n "Copying firmware to $DEVICE ..." | ||
umount /mnt/$DEVICE | ||
echo "Done" | ||
|
||
# Delete device node so we don't try to do it again | ||
rm /dev/$DEVICE | ||
} | ||
|
||
# Must have root permission | ||
if [ "$EUID" -ne 0 ] | ||
then echo "Must run as root or via sudo" | ||
exit | ||
fi | ||
|
||
# Start here | ||
systemctl daemon-reload | ||
|
||
echo "Looking for new devices..." | ||
echo "Hold BOOTSEL for 5 seconds while plugging in." | ||
|
||
# Loop through, looking for device files | ||
while true | ||
do | ||
for I in `ls /dev/sd*1 2>/dev/null` | ||
do new_device $I | ||
done | ||
sleep 5 | ||
done | ||
|
||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Alpha Petal | ||
|
||
Displays a string on the SAO petal, one char at a time. the font is hand drawn and hard coded, crafted with love in the alley. The class needs to be initialized then can be passed a string consisting of [a-z] or space. There is no exception handling. | ||
|
||
|
||
# Usage | ||
### Initialization: | ||
Initialize the class: | ||
`ap = alpha_petal(petal_bus, PETAL_ADDRESS, time)` | ||
|
||
### Functions | ||
`set_slot(slot:int[1-6])` This wraps the `set_rotation` function allowing you to specify a slot on the badge. 1,2,5,6 are recommended. | ||
|
||
`set_rotation(rotation:int[0-7])` This allows you to natively set the rotation, [0-7], 45* incriments | ||
|
||
`rotate_string(string:string)` This displays a string, rotating 45* between each char | ||
|
||
`disp_string(string:string)` This displays a string, should be called after `set_rotation` or `set_slot` | ||
|
||
`petal_letter_reset()` This is used internally to wipe letters | ||
|
||
`petal_char(char:char)` This is used internally to display a single char and then wipe it away | ||
|
||
`touchwheel_string(disp_str:string, touchwheel_bus:bus)` This displays a string which can be rotated with the touchwheel. | ||
|
||
### Usage | ||
#### To just display text: | ||
|
||
`set_rotation(0) #not strictly needed, but it's best to clean up` | ||
|
||
`disp_string('your string ') #the trailing space is important to delinate between the trailing 'g' and leading 'y'` | ||
|
||
#### Display text that rotates: | ||
|
||
Automatically: `rotate_string('your string ')` | ||
|
||
Based on touchwheel: `touchwheel_string('your string ', touchwheel_bus)` |
Oops, something went wrong.