menu.sh 544 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BUILDDIR=".build"

exec 3>&1;

BOARDNAME=$(dialog --no-cancel --no-ok --no-tags --menu \
    "Select your Arduino board model:" 0 0 4 \
    "uno" "Uno" \
    "diecimilaatmega328" "Duemilanove ATmega328" \
    "megaatmega2560" "Mega ATmega2560" \
    "nanoatmega328" "Nano ATmega328" \
    "leonardo" "Leonardo" \)
    2>&1 1>&3);

EXITCODE=$?;
exec 3>&-;

mkdir -p $BUILDDIR && rm -rf $BUILDDIR/* && cd $BUILDDIR \
    && yes | platformio init --board $BOARDNAME \
    && cp -r ../firmware/meteorolog/* src/. && \
    platformio run -t upload