Skip to content

Commit 951231d

Browse files
committed
v1.5.3 add readSerialNumber & writeSerialNumber
1 parent 910ce48 commit 951231d

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

HISTORY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.5.3] - 2016-05-02
2+
3+
### Changes
4+
5+
- Add readSerialNumber & writeSerialNumber function
6+
7+
18
## [1.5.2] - 2016-04-29
29

310
### Changes

uarm_library.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ uArmClass::uArmClass()
2020

2121
}
2222

23+
/* Read Serial Number from EEPROM
24+
* SERIAL NUMBER ADDRESS : 1024, Size: 14
25+
*/
26+
void uArmClass::readSerialNumber(byte (&byte_sn_array)[14]){
27+
for(byte i=0; i<14; i++){
28+
byte_sn_array[i] = EEPROM.read(SERIAL_NUMBER_ADDRESS+i);
29+
}
30+
}
31+
32+
/* Write Serial Number to EEPROM
33+
* SERIAL NUMBER ADDRESS : 1024, Size: 14
34+
*/
35+
void uArmClass::writeSerialNumber(byte (&byte_sn_array)[14]){
36+
for(byte i=0; i<14; i++){
37+
EEPROM.write(SERIAL_NUMBER_ADDRESS+i, byte_sn_array[i]);
38+
}
39+
}
40+
2341
/* Use BUZZER for Alert
2442
* times - how many times
2543
* runTime - how long one time last when BUZZER speak

uarm_library.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define UARM_MAJOR_VERSION 1
2424
#define UARM_MINOR_VERSION 5
25-
#define UARM_BUGFIX 2
25+
#define UARM_BUGFIX 3
2626

2727
#define SERVO_ROT_NUM 0
2828
#define SERVO_LEFT_NUM 1
@@ -85,6 +85,7 @@
8585
#define LINEAR_SLOPE_START_ADDRESS 50
8686
#define OFFSET_START_ADDRESS 30
8787
#define OFFSET_STRETCH_START_ADDRESS 20
88+
#define SERIAL_NUMBER_ADDRESS 1024
8889

8990

9091

@@ -109,7 +110,7 @@
109110
#define INTERP_EASE_IN 3
110111
#define INTERP_EASE_OUT 4
111112

112-
#define LINEAR_INTERCEPT 1
113+
#define LINEAR_INTERCEPT 1
113114
#define LINEAR_SLOPE 2
114115

115116

@@ -119,6 +120,8 @@ class uArmClass
119120
uArmClass();
120121

121122
double readServoOffset(byte servo_num);
123+
void readSerialNumber(byte (&byte_sn_array)[14]);
124+
void writeSerialNumber(byte (&byte_sn_array)[14]);
122125
void readLinearOffset(byte servo_num, double& intercept_val, double& slope_val);
123126
void detachServo(byte servo_num);
124127
void alert(byte times, byte runTime, byte stopTime);

0 commit comments

Comments
 (0)