-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from BrianAdams/30.0.2
30.0.2
- Loading branch information
Showing
22 changed files
with
1,062 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ script: | |
env: | ||
global: | ||
- ARDUINO_IDE_VERSION='1.0.5' | ||
- VERSION_NUMBER="`cat package.json | grep version | grep -o '[0-9]\.[0-9]\.[0-9]\+'`" | ||
- VERSION_NUMBER="`cat package.json | grep version | grep -o '.[0-9]\.[0-9]\.[0-9]\+'`" | ||
- BUILD_NUMBER=$TRAVIS_BUILD_NUMBER | ||
- secure: "P4i5RD2+chpGAPtkn1JYChOc+TVEHdHVVWA40uVAaHqRGm0I/kAvA2i4xXun0VAFFJJjQgC7BSdzQs9kP6IVu4x7VVXyOt3OYMql8ehsH6LU3Q476Rb+HIOzX30qYx+7F+cHUPFp/BTiyEJ+IOjU6sDTWLmSDpjUvVD2Tzg+PLI=" | ||
- REAL_GIT_BRANCH="`git for-each-ref --format='%(objectname) %(refname:short)' refs/heads | ||
|
@@ -24,7 +24,7 @@ after_success: | |
- echo real_get_branch $REAL_GIT_BRANCH | ||
- rm -rf OpenROV/build-* | ||
- 'fpm -f -m [email protected] -s dir -t deb -a armhf -n openrov-arduino-firmware -v | ||
$VERSION_NUMBER-$REAL_GIT_BRANCH.$BUILD_NUMBER.`git rev-parse --short HEAD` --description ''OpenROV Arduino Firmware'' .=/opt/openrov/arduino ' | ||
$VERSION_NUMBER~$BUILD_NUMBER.`git rev-parse --short HEAD` --description ''OpenROV Arduino Firmware'' .=/opt/openrov/arduino ' | ||
- mkdir build | ||
- DEBFILE="`ls *.deb`" | ||
- cp *.deb build/openrov-arduino-firmware_latest-${REAL_GIT_BRANCH}_armhf.deb | ||
|
@@ -45,8 +45,6 @@ deploy: | |
repo: OpenROV/openrov-software-arduino | ||
all_branches: true | ||
condition: "($REAL_GIT_BRANCH = master )||($REAL_GIT_BRANCH = pre-release )||($REAL_GIT_BRANCH = stable)" | ||
after_deploy: | ||
- curl -g http://build.openrov.com:8080/job/OpenROV-generic-upload-deb-to-repo/buildWithParameters -d token=$JENKINS_TOKEN_NAME -d urlToDebPackage=http://openrov-software-nightlies.s3-website-us-west-2.amazonaws.com/arduino-firmware%2F$DEBFILE -d branch=$REAL_GIT_BRANCH | ||
|
||
notifications: | ||
webhooks: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "AConfig.h" | ||
#if(HAS_ALT_SERVO) | ||
#include "Device.h" | ||
#include "Pin.h" | ||
#include "AltServo.h" | ||
#include "Settings.h" | ||
#include <Arduino.h> | ||
#include "openrov_servo.h" | ||
Servo _altservo; | ||
int alts_val = ALTS_MIDPOINT; | ||
int new_alts = ALTS_MIDPOINT; | ||
int altsrate = 1; | ||
|
||
int smoothAdjustedServo(int target, int current){ | ||
double x = target - current; | ||
int sign = (x>0) - (x<0); | ||
int adjustedVal = current + sign * (min(abs(target - current), altsrate)); | ||
return (adjustedVal); | ||
} | ||
|
||
void AltServo::device_setup(){ | ||
_altservo.attach(ALTSERVO_PIN); | ||
_altservo.writeMicroseconds(ALTS_MIDPOINT); | ||
Settings::capability_bitarray |= (1 << ALT_SERVO_CAPABLE); | ||
|
||
} | ||
|
||
void AltServo::device_loop(Command command){ | ||
if (command.cmp("asrt")) { | ||
int ms = map(command.args[1],-100,100,ALTS_MINPOINT,ALTS_MAXPOINT); | ||
if ((ms >= ALTS_MINPOINT) && (ms <= ALTS_MAXPOINT)){ | ||
alts_val = ms; | ||
Serial.print("asr.t:");Serial.print(alts_val);Serial.println(";"); | ||
} | ||
} | ||
if (alts_val != new_alts){ | ||
new_alts = smoothAdjustedServo(alts_val,new_alts); | ||
_altservo.writeMicroseconds(new_alts); | ||
Serial.print("asr.v:");Serial.print(new_alts);Serial.println(";"); | ||
} | ||
|
||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#ifndef __ALTSERVO_H_ | ||
#define __ALTSERVO_H_ | ||
#include "AConfig.h" | ||
#if(HAS_ALT_SERVO) | ||
#include <Arduino.h> | ||
#include "Device.h" | ||
#include "Pin.h" | ||
|
||
#ifndef ALTS_MIDPOINT | ||
#define ALTS_MIDPOINT 1500 | ||
#endif | ||
#ifndef ALTS_MINPOINT | ||
#define ALTS_MINPOINT 1000 | ||
#endif | ||
#ifndef ALTS_MAXPOINT | ||
#define ALTS_MAXPOINT 2000 | ||
#endif | ||
#if(HAS_STD_CAPE) | ||
#include "Cape.h" | ||
#endif | ||
|
||
#if(HAS_OROV_CONTROLLERBOARD_25) | ||
#include "controllerboard25.h" | ||
#endif | ||
|
||
class AltServo : public Device { | ||
public: | ||
AltServo():Device(){}; | ||
void device_setup(); | ||
void device_loop(Command cmd); | ||
}; | ||
#endif | ||
#endif |
Oops, something went wrong.