Skip to content

Commit

Permalink
v1.5.9 fix writeStretch()
Browse files Browse the repository at this point in the history
  • Loading branch information
altjz committed Jun 2, 2016
1 parent 015d42f commit 65192cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.5.9] - 2016-06-01

### Fix
- Fix writeStretch() offset address not correct

## [1.5.8] - 2016-05-07

### Fix
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=uArmLibrary
version=1.5.6
version=1.5.8
author=UFactory <[email protected]>
maintainer=Joey Song <[email protected]>, Alex Tan<[email protected]>
sentence=uArm Library for Arduino
Expand Down
11 changes: 6 additions & 5 deletions uarm_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ void uArmClass::alert(byte times, byte runTime, byte stopTime)
void uArmClass::writeAngle(double servo_rot_angle, double servo_left_angle, double servo_right_angle, double servo_hand_rot_angle)
{
attachAll();

if(servo_left_angle < 10) servo_left_angle = 10;
if(servo_left_angle > 120) servo_left_angle = 120;
if(servo_right_angle < 10) servo_right_angle = 10;
if(servo_right_angle > 110) servo_right_angle = 110;

if(servo_left_angle + servo_right_angle > 160)
if(servo_left_angle + servo_right_angle > 160)
{
servo_right_angle = 160 - servo_left_angle;
return;
Expand All @@ -72,7 +72,7 @@ void uArmClass::writeAngle(double servo_rot_angle, double servo_left_angle, doub
writeServoAngle(SERVO_LEFT_NUM,servo_left_angle,true);
writeServoAngle(SERVO_RIGHT_NUM,servo_right_angle,true);
writeServoAngle(SERVO_HAND_ROT_NUM,servo_hand_rot_angle,true);


// refresh logical servo angle cache
cur_rot = servo_rot_angle;
Expand Down Expand Up @@ -387,8 +387,9 @@ void uArmClass::writeStretch(double armStretch, double armHeight){
}
double offsetL = 0;
double offsetR = 0;
EEPROM.get(OFFSET_STRETCH_START_ADDRESS + 1 * sizeof(offsetL), offsetL);
EEPROM.get(OFFSET_STRETCH_START_ADDRESS + 2 * sizeof(offsetR), offsetR);

EEPROM.get(OFFSET_STRETCH_START_ADDRESS, offsetL);
EEPROM.get(OFFSET_STRETCH_START_ADDRESS + 4, offsetR);
armStretch = constrain(armStretch, ARM_STRETCH_MIN, ARM_STRETCH_MAX) + 68;
armHeight = constrain(armHeight, ARM_HEIGHT_MIN, ARM_HEIGHT_MAX);
double xx = armStretch*armStretch + armHeight*armHeight;
Expand Down
4 changes: 1 addition & 3 deletions uarm_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
* Author : Joey Song
* Updated : Joey Song, Alex Tan, Dave Corboy
* Email : [email protected]
* Version : V1.4.0
* Date : 12 Dec, 2014
* Modified Date : 11 Apr, 2016
* Description :
* License :
* Copyright(C) 2016 UFactory Team. All right reserved.
Expand All @@ -22,7 +20,7 @@

#define UARM_MAJOR_VERSION 1
#define UARM_MINOR_VERSION 5
#define UARM_BUGFIX 8
#define UARM_BUGFIX 9

#define SERVO_ROT_NUM 0
#define SERVO_LEFT_NUM 1
Expand Down

0 comments on commit 65192cc

Please sign in to comment.