Skip to content

Commit

Permalink
build using tectonic
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Feb 5, 2018
1 parent fc5a882 commit 8badab0
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 28 deletions.
39 changes: 31 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
notification:
notifications:
email: false
before_install:
- sudo apt-get update
- sudo apt-get install texlive-latex-extra
script:
- mkdir _build
- travis_wait 3 pdflatex -output-directory _build ./Documentation/src/Documentation.tex
install:
# Silent install from conda docs
# https://conda.io/docs/user-guide/install/macos.html#install-macos-silent
# adapted using
# https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html

# Needed to check if conda already installed
- export PATH="$HOME/miniconda/bin:$PATH"

# If not yet installed, obtain Miniconda
# and tectonic
# From tectonic docs
# https://tectonic-typesetting.github.io/en-US/install.html#the-anaconda-method
- if ! command -v conda > /dev/null; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda -u;
conda config --add channels conda-forge;
conda config --set always_yes yes;
conda update --all;
conda install tectonic;
fi
- conda info -a
cache:
directories:
- $HOME/miniconda
script: # Change working directory each time so including files will work. Change back so the pdfs can be found for deployment. This way, building multiple files goes well.
- cd ./documentation/src/
- tectonic ./documentation.tex --print
- cd ../
deploy:
provider: releases
api_key:
secure: rQIugDrSWmIXr7oIIxhcpvPIAql6YYc0+4+yIyHi2iJ3jYuOT7EI/a1q81tKMvPOXs/U+vyLIhyyzstK4KXkRj0wTS+e518PE9VZyysVRkmzX8fQkScjne4ITTXOeAsxpTU9gm7QnS+evtalt5izIbsBl/6lJY0HnrVwtd7PmMB2v9IQhF+FuoZRVJF+MWBUrENNPPP6p4PLXbbZgFUaYDvQuIyZvn5EGSlSnVlUmgggkUJJtjs+H+j0M7Ju+wk1jVhO3e4VQa8lO9NN3m8U2aYz99zgT2yLZQ/gBa1OeKsVfJuhajOfnigUuGhsZD2PXPHZdLlxPI2SuxsSUmFnJesxVaTHTROz+e8d+xL90iyCq/l1p8BUiap1ZNalkbYK637TiPnxLKVKhzDDH0Sf+OjY92HK0cpBSKBCvlH+JYX4EY/DqIBubFCctc5Qd/PqcYZqyKCepadnKB+nXWpmp4n9Sr2/wA4EDdrMsRIlNHOi0cfiGleo9abJ/ZiDVUekW0Bgic3rCIZlN8S05huXuWxWJTBJvMtA1w2XyRCejapVo4EH1w8uxTClwiT4V++bMOpQK9QYd2L9vIMXy7J4h+iFhGO9vkP09ACEo40SS77+zFq79aEYTOIcqjP5uB3RhV8tKAfv4MTuL9x50yPzobr0hzTVxengQPYAmEldQj4=
file:
- ./_build/Documentation.pdf
- ./documentation/src/documentation.pdf
skip_cleanup: true
on:
tags: true
Expand Down
Binary file removed Documentation/Documentation.pdf
Binary file not shown.
16 changes: 14 additions & 2 deletions SolArduino_atom/SolArduino/SolArduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const int SAMPLE_RATE = 500; //amount of readings to take the average of when re
//experimentally determined values of potmeter and angle ends
const int SOFT_BOUND = 5; // about 5 /( (970-611)/(570-50) ) = 0.7 degrees safety
//NOTE especially in solarPanelUp/Down we assumed the low end has the lowest number!!
const int POTMETER_LOWEND = 611 + SOFT_BOUND; // was 652
const int POTMETER_HIGHEND = 970 - SOFT_BOUND; //was 977, 1007
const int POTMETER_LOWEND = 0; // was 611, was 652
const int POTMETER_HIGHEND = 1000; //was 970, was 977, 1007
const int DEGREES_HIGHEND = 570 - 7; //angle * 10 for more precision, including soft bound
const int DEGREES_LOWEND = 50 + 7;

Expand Down Expand Up @@ -98,6 +98,18 @@ void loop () {
if (!(EmergencyState == "")) {
solarPanelStop();
}

// Useful for calibrating potmeter
// printPotmeterValue();
}

unsigned long potMeterCount = millis();
void printPotmeterValue() {
if (millis() > potMeterCount + 1000) {
Serial.println(readPotMeter());
potMeterCount = millis();
}

}

//get next auto angle, if -1 then ran out of angles
Expand Down
36 changes: 18 additions & 18 deletions SolArduino_atom/SolArduino/solarPanelControl.ino
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ void solarPanelAuto() {
// timeout is set to a value in the future on user up/down requests
void checkMovingTimeout() {
if (millis() > moveTimeout and !panelsStopped) {
Serial.print(F("timed out at"));
Serial.println(millis());
// Serial.print(F("timed out at"));
// Serial.println(millis());
solarPanelStop();
}
}

void resetMoveTimeout() {
moveTimeout = millis() + MOVE_TIMEOUT_DELTA;
Serial.print(F("set moveTimeout at "));
Serial.print(millis());
Serial.print(F(" for "));
Serial.println(moveTimeout);
// Serial.print(F("set moveTimeout at "));
// Serial.print(millis());
// Serial.print(F(" for "));
// Serial.println(moveTimeout);
}

int getCurrentAngle() {
Expand Down Expand Up @@ -114,16 +114,16 @@ void solarPanelDown() {
if (analogRead(POTMETERPIN) < POTMETER_HIGHEND) {
aboveUpperBound = false;
}
if (analogRead(POTMETERPIN) > POTMETER_LOWEND) { // if panels not below lower bound, move down
// if (analogRead(POTMETERPIN) > POTMETER_LOWEND) { // if panels not below lower bound, move down
panelsStopped = false;
Serial.println(F("Panels going down"));
// Serial.println(F("Panels going down"));
digitalWrite(POWER_LOW, HIGH); //Put current via the low end stop to 28
digitalWrite(POWER_HIGH, LOW); //Make sure the high end circuit is not on
digitalWrite(DIRECTION_PIN, HIGH); //To go down, also let the current flow to E4
} else { // panels below lower bound
belowLowerBound = true;
solarPanelStop();
}
// } else { // panels below lower bound
// belowLowerBound = true;
// solarPanelStop();
// }
} else {
solarPanelStop();
}
Expand All @@ -135,16 +135,16 @@ void solarPanelUp() {
if (analogRead(POTMETERPIN) > POTMETER_LOWEND) { // if we move above low bound, reset flag
belowLowerBound = false;
}
if (analogRead(POTMETERPIN) < POTMETER_HIGHEND) {
// if (analogRead(POTMETERPIN) < POTMETER_HIGHEND) {
panelsStopped = false;
Serial.println(F("Panels going up"));
// Serial.println(F("Panels going up"));
digitalWrite(POWER_LOW, LOW);
digitalWrite(POWER_HIGH, HIGH);
digitalWrite(DIRECTION_PIN, LOW);
} else { // we are above upper bound, do not go up
aboveUpperBound = true;
solarPanelStop();
}
// } else { // we are above upper bound, do not go up
// aboveUpperBound = true;
// solarPanelStop();
// }
} else {
solarPanelStop();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit 8badab0

Please sign in to comment.