Made mfrc522.py part of our micropython environment.

This commit is contained in:
2024-12-03 20:00:01 +01:00
parent 3deba7d604
commit f00b2b1ab1
2 changed files with 2 additions and 33 deletions

View File

@@ -8,3 +8,5 @@ require("aioble")
module("rp2_neopixel.py", "../../src")
require("sdcard")
require("aiorepl")
module("mfrc522.py", "../../lib/micropython-mfrc522/")

View File

@@ -1,33 +0,0 @@
#!/usr/bin/bash
set -eu
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
MFRC522_LIBDIR=$(readlink -f "$SCRIPT_DIR"/../../lib/micropython-mfrc522)
error_exit()
{
MESSAGE="$1"
echo "Error: $MESSAGE"
echo "Exit."
exit 1
}
check_command()
{
CMD="$1"
if ! command -v "$CMD" 2>&1 >/dev/null
then
error_exit "'$CMD' not found."
fi
}
check_command mpremote
mpremote fs cp "$MFRC522_LIBDIR/mfrc522.py" ":mfrc522.py"
mpremote reset
echo "Library deployed. Run main.py with 'mpremote run main.py'"