Skip to content

Cleanup/examples #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion arduino/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def get_template_path():
return '/'.join(__file__.split('/')[:-1]) + '/template.tpl'

def create_sketch(sketch_name = None, destination_path = '.', overwrite = False, source_path = None):

if sketch_name is None:
sketch_name = 'main'
new_sketch_path = f'{destination_path}/{sketch_name}.py'
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 11 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/bin/bash
#
# Install Arduino Runtime to a MicroPython board using mpremote.
# MicroPython Package Installer
# Created by: Ubi de Feo and Sebastian Romero
#
# Installs a MicroPython Package to a board using mpremote.
#
# This script accepts an optional argument to compile .py files to .mpy.
# Simply run the script with the optional argument:
#
# ./install.sh mpy

# Name to display during installation
PKGNAME="Arduino Runtime for MicroPython"
# Destination directory for the package on the board
PKGDIR="arduino"
# Source directory for the package on the host
SRCDIR=$PKGDIR
# Board library directory
LIBDIR="lib"

# File system operations such as "mpremote mkdir" or "mpremote rm"
Expand Down Expand Up @@ -86,6 +94,8 @@ for filename in $SRCDIR/*; do
source_extension="${f_name##*.}"
destination_extension=$source_extension

# If examples are distributed within the package
# ensures they are copied but not compiled to .mpy
if [[ -d $filename && "$f_name" == "examples" ]]; then
if ! directory_exists "/${LIBDIR}/${PKGDIR}/examples"; then
echo "Creating $LIBDIR/$PKGDIR/examples on board"
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"urls": [
["arduino/__init__.py", "github:arduino/arduino-runtime-mpy/arduino/__init__.py"],
["arduino/arduino.py", "github:arduino/arduino-runtime-mpy/arduino/arduino.py"],
["arduino/template.tpl", "github:arduino/arduino-runtime-mpy/arduino/template.tpl"]
["arduino/template.tpl", "github:arduino/arduino-runtime-mpy/arduino/template.tpl"],
["arduino/examples/00_basic.py", "github:arduino/arduino-runtime-mpy/arduino/examples/00_basic.py"],
["arduino/examples/01_arduino_blink.py", "github:arduino/arduino-runtime-mpy/arduino/examples/01_arduino_blink.py"],
["arduino/examples/02_nano_esp32_advanced.py", "github:arduino/arduino-runtime-mpy/arduino/examples/02_nano_esp32_advanced.py"]
],
"deps": [],
"version": "0.1.0"
Expand Down