From b3c05a61ecf262b9921394482efd6ecd4059786e Mon Sep 17 00:00:00 2001 From: David Madison Date: Thu, 18 Oct 2018 16:05:41 -0400 Subject: [PATCH 1/4] Adds Travis-CI support Building the main sketch for the Arduino Uno with the WS2812B chipset. --- .travis.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6cab7ac --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +language: C +env: + global: + - IDE_VERSION=1.8.1 +matrix: + include: + - name: "Arduino Uno - WS2812B" + env: BOARD=arduino:avr:uno + +before_install: + - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16" + - sleep 3 + - export DISPLAY=:1.0 + + # Install Arduino IDE + - wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz + - tar xf arduino-$IDE_VERSION-linux64.tar.xz + - sudo mv arduino-$IDE_VERSION /usr/local/share/arduino + - sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino + + # Install Libraries + - arduino --install-library "FastLED:3.2.0" + + # Sketch Compiling Functions + - CYAN="\033[36m"; NOC="\033[0m"; + - buildSketchPath() { + echo -e "\n${CYAN}Building sketch ${1##*/}${NOC}"; + arduino --verify --board $BOARD "$1"; + } + - buildAllSketches() { + for f in $(find $PWD -name '*.ino'); + do + buildSketchPath $f; + done; + } + +script: + - buildAllSketches + +notifications: + email: + on_success: change + on_failure: change From 173470ff316548b38cbc58bc2d1be17624378fdd Mon Sep 17 00:00:00 2001 From: David Madison Date: Thu, 18 Oct 2018 16:09:08 -0400 Subject: [PATCH 2/4] Fixes unused variable warning for serial flush --- Arduino/LEDstream_FastLED/LEDstream_FastLED.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino index 0a390b1..28c0af3 100644 --- a/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino +++ b/Arduino/LEDstream_FastLED/LEDstream_FastLED.ino @@ -250,6 +250,6 @@ void timeouts(){ void serialFlush(){ while(Serial.available() > 0) { - byte r = Serial.read(); + Serial.read(); } } From 67803756af0677c929e06ee545fe937d368ab5d2 Mon Sep 17 00:00:00 2001 From: David Madison Date: Thu, 18 Oct 2018 16:13:17 -0400 Subject: [PATCH 3/4] Adds Travis CI status image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c2c8e5..5157a8b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Adalight-FastLED +# Adalight-FastLED [![Build Status](https://travis-ci.org/dmadison/Adalight-FastLED.svg?branch=master)](https://travis-ci.org/dmadison/Adalight-FastLED) ![Adalight-Rainbow](http://i.imgur.com/sHygxq9.jpg) From 5e16a0a6c48729f282a1039da82b95984e169829 Mon Sep 17 00:00:00 2001 From: David Madison Date: Thu, 18 Oct 2018 17:03:19 -0400 Subject: [PATCH 4/4] Tests Nano, Leonardo, and Mega (CI) I know the Uno and Nano should be the same build process, just being thorough. --- .travis.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6cab7ac..1aae66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ env: - IDE_VERSION=1.8.1 matrix: include: - - name: "Arduino Uno - WS2812B" - env: BOARD=arduino:avr:uno + - name: "WS2812B" before_install: - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16" @@ -22,7 +21,7 @@ before_install: - arduino --install-library "FastLED:3.2.0" # Sketch Compiling Functions - - CYAN="\033[36m"; NOC="\033[0m"; + - CYAN="\033[36m"; YELLOW="\033[33m"; NOC="\033[0m"; - buildSketchPath() { echo -e "\n${CYAN}Building sketch ${1##*/}${NOC}"; arduino --verify --board $BOARD "$1"; @@ -33,9 +32,17 @@ before_install: buildSketchPath $f; done; } + - buildBoard() { + export BOARD="$1"; + echo -e "\n${YELLOW}Now using board $BOARD${NOC}"; + buildAllSketches; + } script: - - buildAllSketches + - buildBoard "arduino:avr:uno" + - buildBoard "arduino:avr:nano:cpu=atmega328" + - buildBoard "arduino:avr:leonardo" + - buildBoard "arduino:avr:mega:cpu=atmega2560" notifications: email: