ws281x/dev.sh

22 lines
628 B
Bash
Raw Normal View History

2024-12-07 08:42:50 +00:00
#!/bin/bash
2024-12-11 09:41:16 +00:00
# Reset the MicroPython device
mpremote reset || { echo "Failed to reset device"; exit 1; }
# Loop through all files in ./src recursively
find ./src -type f | while read -r file; do
filename=$(basename "$file") # Extract filename from full path
# Skip copying settings.json
if [ "$filename" == "settings.json" ]; then
echo "Skipping $filename"
continue
fi
echo "Copying $filename"
mpremote cp "$file" :$filename || { echo "Failed to copy $filename"; exit 1; }
done
# Run the main.py script on the MicroPython device
mpremote run src/main.py || { echo "Failed to run main.py"; exit 1; }