Major bug fix + fix building PRs on adafruit/travis-ci-arduino (#27)

* Fix install.sh path

* Fix

* Remove newline

* Fix Arduino IDE reinstall

* Use normal blink instead of BlinkPlus
This commit is contained in:
Kryštof Černý 2018-07-18 20:41:36 +02:00 committed by Limor "Ladyada" Fried
parent aa64a8fc4a
commit e38c333761
4 changed files with 39 additions and 50 deletions

View file

@ -13,7 +13,7 @@ env:
global:
- ARDUINO_IDE_VERSION="1.8.5"
before_install:
- source <(curl -SLs https://raw.githubusercontent.com/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/install.sh)
- source $TRAVIS_BUILD_DIR/install.sh
script:
- build_platform esp32
- build_platform uno

37
examples/Blink/Blink.ino Normal file
View file

@ -0,0 +1,37 @@
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Blink
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

View file

@ -1,49 +0,0 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://www.arduino.cc
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
modified 19 Dec 2015
by Olivier Chatelain
modified 9 Jan 2016
by Olivier Chatelain
For Digispark
*/
// #define LED_PIN_FIRST 0 // First pin
#define LED_PIN_FIRST 1 // Digispark
// #define LED_PIN_FIRST 13 // Arduino UNO
// #define LED_PIN_LAST 19
#ifndef LED_PIN_LAST
#define LED_PIN_LAST LED_PIN_FIRST
#endif
#define DELAY_HIGH_ON 400
#define DELAY_LOW_OFF 600
// the setup function runs once when you press reset or power the board
void setup() {
// initialize the pin range "first" to "last" as an output.
for(int i = LED_PIN_FIRST; i <= LED_PIN_LAST; i++) pinMode(i, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
for(int i = LED_PIN_FIRST; i <= LED_PIN_LAST; i++) digitalWrite(i, HIGH); // turn the LED on (HIGH is the voltage level)
delay( DELAY_HIGH_ON ); // wait for a second
for(int i = LED_PIN_FIRST; i <= LED_PIN_LAST; i++) digitalWrite(i, LOW); // turn the LED off by making the voltage LOW
delay( DELAY_LOW_OFF ); // wait for a second
}

View file

@ -34,6 +34,7 @@ if [ -z $ARDUINO_IDE_VERSION ]; then export ARDUINO_IDE_VERSION="1.8.5"; fi
# if newer version is requested
if [ ! -f $HOME/arduino_ide/$ARDUINO_IDE_VERSION ] && [ -f $HOME/arduino_ide/arduino ]; then
shopt -s extglob
cd $HOME/arduino_ide/
rm -r -f !(esp32)
cd $OLDPWD
echo "DIFFERENT VERSION OF ARDUINO IDE REQUESTED!"