PlatformIO project for implementing a rotating nametag on the Hackaday Supercon 2023 badge
Go to file
Amelia Wietting ce3b97ebda Minor changes 2023-11-21 17:43:41 -06:00
.vscode Initial working rotating nametag 2023-11-04 07:42:38 -07:00
data Here's the code from SuperCon 2023 for Porthole Earth! Sorry for how bad the code is, but it works for me 2023-11-21 17:04:01 -06:00
include Add images, display images 2023-11-04 14:30:45 -07:00
lib Here's the code from SuperCon 2023 for Porthole Earth! Sorry for how bad the code is, but it works for me 2023-11-21 17:04:01 -06:00
src Here's the code from SuperCon 2023 for Porthole Earth! Sorry for how bad the code is, but it works for me 2023-11-21 17:04:01 -06:00
test Initial working rotating nametag 2023-11-04 07:42:38 -07:00
unused Initial working rotating nametag 2023-11-04 07:42:38 -07:00
.gitignore Initial working rotating nametag 2023-11-04 07:42:38 -07:00
README.md Minor changes 2023-11-21 17:43:41 -06:00
platformio.ini Here's the code from SuperCon 2023 for Porthole Earth! Sorry for how bad the code is, but it works for me 2023-11-21 17:04:01 -06:00

README.md

Nametag FW for SC7 VectorScope Badge

This code implements a wobbling earth. I stole the base C++ animation code from true.

Install PlatformIO to build this firmware.

Edit main.cpp to set your number of pictures.

Prepping the photos

Add photos to /data at 240x240. use the following commands and script with ffmpeg to prep the photos.

    # Source and destination directories
    src_dir="output"
    dest_dir="ioutput"
    #!/bin/bash
    mkdir src_dir
    mkdir dest_dir

    ffmpeg -i source_video.avi -vf ./output/out%d.jpg

    # Create the destination directory if it doesn't exist
    mkdir -p $dest_dir

    # Loop over all JPG files in the source directory
    i=0
    cur_count=0
    for file in $src_dir/*.jpg; do
        #if (( i % 3 == 0 )); then
        
            ((cur_count++))
            # Construct the destination file name with padding
            dest_file="$dest_dir/out$(printf "%05d" $cur_count).jpg"
            # Change the image size and quality and save it to the destination directory
            # Be careful with size, you WILL need to compile a filesystem to contain your images which will tell you if you're too big
            # Keep this below 1MB
            convert $file -quality 50 -resize 240x240 $dest_file
        #fi
        #((i++))
    done

Prepping the PIO

  • Copy the images from your above code output to the data directory of this repository
  • In VSCode PIO open the PIO tab and select the BUILD options
    • Rename your last photo with all 0's because I'm lazy and am not writing a function to automate fetching the list right now
    • Build the filesystem. If it doesn't error, cool, your photos will fit!
    • Edit main.cpp with the correct number of photos
    • Upload the filesystem using PlatformIO
    • Upload the code to your badge
    • Make sure the sensors are connected to SCL and SDA on pin 26 and 27