diff --git a/.arduino-ci.yml b/.arduino-ci.yml index 570dd921..9db6f922 100644 --- a/.arduino-ci.yml +++ b/.arduino-ci.yml @@ -8,7 +8,6 @@ platforms: features: defines: - __AVR_ATmega2560__ - # added this line - ARDUINO_CI warnings: flags: @@ -16,7 +15,11 @@ platforms: unittest: platforms: - mega2560 - + libraries: + - "LiquidCrystal" + compile: platforms: - mega2560 + libraries: + - "LiquidCrystal" diff --git a/.github/workflows/Arduino-CI.yaml b/.github/workflows/Arduino-CI.yaml index f608913a..4d0deba2 100644 --- a/.github/workflows/Arduino-CI.yaml +++ b/.github/workflows/Arduino-CI.yaml @@ -20,6 +20,11 @@ jobs: - run: | bundle install + # Installing libraries needed for this project + - name: Install libraries + run: | + ./scripts/install_libraries.sh + # Finally, run the tests - run: | - bundle exec arduino_ci_remote.rb --skip-compilation + bundle exec arduino_ci_remote.rb diff --git a/Gemfile b/Gemfile index fb422d12..901f706e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,2 @@ source 'https://rubygems.org' -gem 'arduino_ci' +gem 'arduino_ci', git: 'https://github.com/ianfixes/arduino_ci.git', branch: '2020-10-16_suggestions' diff --git a/examples/Blink/Blink.ino b/examples/Blink/Blink.ino deleted file mode 100644 index 6236263f..00000000 --- a/examples/Blink/Blink.ino +++ /dev/null @@ -1,10 +0,0 @@ - -#include "TankControllerLib.h" -TankControllerLib tank; - -void setup() { - tank.setup(); -} -void loop() { - tank.loop(); -} diff --git a/examples/TankController/TankController.ino b/examples/TankController/TankController.ino new file mode 100644 index 00000000..6aa3c7c5 --- /dev/null +++ b/examples/TankController/TankController.ino @@ -0,0 +1,10 @@ + +#include "TankControllerLib.h" +TankControllerLib *tank = TankControllerLib::instance(); + +void setup() { + tank->setup(); +} +void loop() { + tank->loop(); +} diff --git a/library.properties b/library.properties index ca36489d..975f8c45 100644 --- a/library.properties +++ b/library.properties @@ -4,6 +4,6 @@ author=James Foster maintainer=James Foster sentence=Software for the Arduino that controls pH and temperature in the Ocean Acidification project. paragraph= -category=Device Congtrol +category=Device Control url=https://github.com/Open-Acidification/TankControllerLib -architectures=* +architectures=avr diff --git a/scripts/install_libraries.sh b/scripts/install_libraries.sh new file mode 100755 index 00000000..6f73e8dc --- /dev/null +++ b/scripts/install_libraries.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# set up directories +bundle exec ensure_arduino_installation.rb + +# get custom version of LiquidCrystal +git clone https://github.com/Arduino-CI/LiquidCrystal.git +mv LiquidCrystal $(bundle exec arduino_library_location.rb) + diff --git a/src/Devices/LiquidCrystal_TC.cpp b/src/Devices/LiquidCrystal_TC.cpp new file mode 100644 index 00000000..a7b4310f --- /dev/null +++ b/src/Devices/LiquidCrystal_TC.cpp @@ -0,0 +1 @@ +#include "LiquidCrystal_TC.h" diff --git a/src/Devices/LiquidCrystal_TC.h b/src/Devices/LiquidCrystal_TC.h new file mode 100644 index 00000000..45d9a1a6 --- /dev/null +++ b/src/Devices/LiquidCrystal_TC.h @@ -0,0 +1,19 @@ +#include +#ifdef ARDUINO_CI +#include +#else +#include +#endif + +class LiquidCrystal_TC { +private: + const int RS = 24, EN = 22, D4 = 26, D5 = 28, D6 = 30, D7 = 32; + LiquidCrystal* pLCD; // (RS, EN, D4, D5, D6, D7); + +public: + LiquidCrystal_TC(); + ~LiquidCrystal_TC(); + void clear(); + void setCursor(); + void print(); +};