Skip to content

Commit

Permalink
Merge pull request #1 from Hack-a-Day/main
Browse files Browse the repository at this point in the history
merger from supercon
  • Loading branch information
joeynelson authored Nov 4, 2024
2 parents 37e97a1 + 49a72ef commit 3a6b497
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
[submodule "software/libraries/MicroPython-SSD1306"]
path = software/libraries/MicroPython-SSD1306
url = https://github.com/TimHanewich/MicroPython-SSD1306
[submodule "software/libraries/micropython-aw210xx"]
path = software/libraries/micropython-aw210xx
url = https://github.com/eosti/micropython-aw210xx
[submodule "i2c_proto_petal_tutorial/pico_ch32v003_prog"]
path = i2c_proto_petal_tutorial/pico_ch32v003_prog
url = [email protected]:hexagon5un/pico_ch32v003_prog.git
[submodule "software/libraries/MicroPython-IR-Transceiver-SAO"]
path = software/libraries/MicroPython-IR-Transceiver-SAO
url = https://github.com/DmitryPustovit/MicroPython-IR-Transceiver-SAO

13 changes: 13 additions & 0 deletions i2c-addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ If you have made an SAO that you are bringing, please add it to this list submit
| 0x00 | LED Petal Matrix | AS1115's default. Can override. | |
| 0x12 | I2C Proto Badge (default) | In firmware, change to whatever | |
| 0x19 | Blinky Loop SAO | Can also use 0x18 | [hackaday.io](https://hackaday.io/project/198163-blinky-loop-sao) |
| 0x19 | Etch sAo Sketch (accel.) | LIS3DH, can also use 0x18 | [hackaday.io](https://hackaday.io/project/197581-etch-sao-sketch) |
| 0x1A | Hack-Man SAO | See project for commands | [hackaday.io](https://hackaday.io/project/198301-hack-man-sao) |
| 0x27 | SAO Core4 | MCP23017 IO Exp 0x20-27 | [hackaday.io](https://hackaday.io/project/197235-sao-core4-a-nibble-of-core-memory-with-i2c) |
| 0x3C | SAO Speak and Spell | OLED 128x32 | [hackaday.io](https://hackaday.io/project/198045-sao-speak-and-spell) |
| 0x3C | Etch sAo Sketch (OLED) | OLED 128x128, can also use 0x3D | [hackaday.io](https://hackaday.io/project/197581-etch-sao-sketch) |
| 0x3C | SAO OLED | OLED 128x64, can also use 0x3D | [hackaday.io](https://hackaday.io/project/194077-sao-oled) |
| 0x52 | SAO Nunchuck | Wii Nunchuck at 0x52 | [hackaday.io](https://hackaday.io/project/198000-sao-nunchuck-adapter) |
| 0x55 | Badge Tag NFC SAO | Can be changed in a register | [hackaday.io](https://hackaday.io/project/198165-badge-tag-nfc-sao) |
| 0x0A | Mac SAO | 0x22 and 0x56 as alternates | [aeiche.com](https://aeiche.com/macsao) |
| 0x30 | Metamer SAO | Contains bootstrap I2C MCU | [hackaday.io](https://hackaday.io/project/198439-metamer-sao) |
| 0x1A | Hack-Man SAO | See project for commands | [hackaday.io](https://hackaday.io/project/198301-hack-man-sao) |
| 0x54 | TouchwheelSAO | Can change addr in Arduino src | [hackaday.io](https://hackaday.io/project/199100-touchwheelsao) |
| 0x6C | duckGLOW SAO | Change to 0x6C-06F w/ solder jumpers | [hackaday.io](https://hackaday.io/project/198918-duckglow-sao) |
| 0x13 | Skull of Fate SAO | Can be changed. See doc. | [hackaday.io](https://hackaday.io/project/198974-skull-of-fate-sao) |
| 0x08 | Infrared Communication SAO (TV Remote SAO) | See project for commands. | [hackaday.io](https://hackaday.io/project/197812-infrared-communication-sao) |

2 changes: 1 addition & 1 deletion i2c_proto_petal_tutorial/pico_ch32v003_prog
54 changes: 54 additions & 0 deletions software/badge_image/flash_badge.sh
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
37 changes: 37 additions & 0 deletions software/libraries/Alpha_Petal/README.md
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)`
Loading

0 comments on commit 3a6b497

Please sign in to comment.