Skip to content

Commit 75b4252

Browse files
authored
update github actions (#38)
- update GitHub actions - update license 2023 - edit changelog.md - update readme.md - minor edits
1 parent 3d99d0b commit 75b4252

File tree

12 files changed

+81
-73
lines changed

12 files changed

+81
-73
lines changed

CHANGELOG.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [0.3.8] - 2022-10-07
98

9+
## [0.3.9] - 2023-01-27
10+
- update GitHub actions
11+
- update license 2023
12+
- edit changelog.md
13+
- update readme.md
14+
- minor edits
15+
16+
17+
## [0.3.8] - 2022-10-07
1018
- added CHANGELOG.md
1119
- fix #36 - limit values of pitch() roll() yaw() to 0..360 range.
1220
- rename three constants, move to .h.
@@ -16,83 +24,68 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1624
- updated documentation a bit.
1725

1826
## [0.3.7] - 2022-07-26
19-
2027
- add partial reads readAccel(), readGyro() and readTemperature()
2128
- rename + add GY521_LIB_VERSION to examples.
2229

2330
## [0.3.6] - 2021-12-18
24-
2531
- update library.json, license, minor edits
2632

2733
## [0.3.5] - 2021-10-20
28-
2934
- update build-CI, badges
3035
- fix #28 add wakeup to begin().
3136

3237
## [0.3.4] - 2021-07-12
33-
3438
- fix #24 improve precision
3539

3640
## [0.3.3] - 2021-07-05
37-
3841
- fix #22 improve maths
3942

4043
## [0.3.2] - 2021-07-05
41-
4244
- fix #20 support multiWire
4345

4446
## [0.3.1] - 2021-06-13
45-
4647
- added more unit test
4748
- some initialization
4849

4950
## [0.3.0] - 2021-04-07
50-
5151
- fix #18 acceleration error correction (kudo's to Merkxic)
5252

53-
## [0.2.3] - 2021-01-26
53+
----
5454

55+
## [0.2.3] - 2021-01-26
5556
- align version numbers (oops)
5657

5758
## [0.2.2] - 2021-01-24
58-
5959
- add interface part to readme.md
6060
- add GY521_registers.h
6161

6262
## [0.2.1] - 2020-12-24
63-
6463
- add Arduino-CI build
6564
- add unit tests
6665

6766
## [0.2.0] - 2020-11-03
68-
6967
- improve error handling
7068

71-
## [0.1.5] - 2020-09-29
69+
----
7270

71+
## [0.1.5] - 2020-09-29
7372
- fix #6 fix maths for Teensy
7473

7574
## [0.1.4] - 2020-09-29
76-
7775
- fix #5 missing ;
7876

7977
## [0.1.3] - 2020-08-07
80-
8178
- fix ESP support
8279
- add pitch roll yaw demo
8380

8481
## [0.1.2] - 2020-08-06
85-
8682
- fix setAccelSensitivity
8783
- add getters
8884

8985
## [0.1.1] - 2020-07-09
90-
9186
- refactor
9287
- initial release
9388

9489
## [0.1.0] - 2017-11-20
95-
9690
- initial version
9791

98-

GY521.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: GY521.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.3.8
4+
// VERSION: 0.3.9
55
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
66
// URL: https://github.com/RobTillaart/GY521
77

GY521.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: GY521.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.3.8
5+
// VERSION: 0.3.9
66
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
77
// URL: https://github.com/RobTillaart/GY521
88
//
@@ -12,12 +12,12 @@
1212
#include "Wire.h"
1313

1414

15-
#define GY521_LIB_VERSION (F("0.3.8"))
15+
#define GY521_LIB_VERSION (F("0.3.9"))
1616

1717

1818
// THROTTLE TIMING
1919
#ifndef GY521_THROTTLE_TIME
20-
#define GY521_THROTTLE_TIME 10 // milliseconds
20+
#define GY521_THROTTLE_TIME 10 // milliseconds
2121
#endif
2222

2323

@@ -38,7 +38,7 @@
3838
class GY521
3939
{
4040
public:
41-
GY521(uint8_t address = 0x69, TwoWire *wire = &Wire); // 0x68 or 0x69
41+
GY521(uint8_t address = 0x69, TwoWire *wire = &Wire); // 0x68 or 0x69
4242

4343

4444
#if defined (ESP8266) || defined(ESP32)
@@ -140,4 +140,4 @@ class GY521
140140
};
141141

142142

143-
// -- END OF FILE --
143+
// -- END OF FILE --

GY521_registers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99

10-
// keep names in sync with BIG MPU6050 lib
10+
// keep names in sync with BIG MPU6050 lib
1111

1212

1313
#define GY521_XG_OFFS_TC 0x00
@@ -141,5 +141,5 @@
141141
#define GY521_WHO_AM_I 0x75
142142

143143

144-
// -- END OF FILE --
144+
// -- END OF FILE --
145145

README.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,29 @@ It needs to be tested a lot more.
2121

2222
#### Examples
2323

24-
- calibration example to determine the offsets needed
25-
- example to read values.
26-
- test sketch to test get / set values.
27-
- example to get pitch roll yaw.
28-
- performance sketch.
24+
- **GY521_angle** read angleX, angleY, angleZ.
25+
- **GY521_performance** measure performance.
26+
- **GY521_pitch_roll_yaw** to get pitch roll yaw.
27+
- **GY521_readCalibration_1** read calibration values / errors for a flat sensor.
28+
- **GY521_readCalibration_2** generate calibration code snippet.
29+
- **GY521_test_1** test working of the sensor.
30+
- **GY521_test_2** test set/get functions.
2931

3032

3133
## Breakout board
3234

3335
From left to right
3436

35-
| pin | pinName | description |
36-
|:----:|:--------|:----------------|
37-
| 0 | VCC | +5V |
38-
| 1 | GND | ground |
39-
| 2 | SCL | I2C clock |
40-
| 3 | SDA | I2C data |
41-
| 4 | XDA | auxiliary data | see datasheet
42-
| 5 | XCL | auxiliary clock | see datasheet
43-
| 6 | AD0 | address |
44-
| 7 | INT | interrupt |
37+
| pin | pinName | description | notes |
38+
|:-----:|:---------:|:------------------|:-------:|
39+
| 0 | VCC | +5V |
40+
| 1 | GND | ground |
41+
| 2 | SCL | I2C clock |
42+
| 3 | SDA | I2C data |
43+
| 4 | XDA | auxiliary data | see datasheet
44+
| 5 | XCL | auxiliary clock | see datasheet
45+
| 6 | AD0 | address |
46+
| 7 | INT | interrupt |
4547

4648

4749
#### Address
@@ -60,6 +62,9 @@ AD0 connected to VCC => 0x69
6062

6163
## Interface
6264

65+
```cpp
66+
#include "GY521.h"
67+
```
6368

6469
### Constructor
6570

@@ -80,7 +85,7 @@ AD0 connected to VCC => 0x69
8085
- **uint16_t getThrottleTime()** returns throttle time set.
8186

8287

83-
### READ
88+
### Read
8489

8590
#### Set before read
8691

@@ -104,7 +109,7 @@ returns status = GY521_OK on success.
104109

105110
Since version 0.3.8 the **read()** and **readGyro()** function is updated to keep the range of **getPitch()**,
106111
**getRoll()** and **getYaw()** in the range 0..360 degrees. (Issue #36).
107-
Problem is that with continuous roatation in a same direction internal variables will overflow and new
112+
Problem is that with continuous rotation in a same direction internal variables will overflow and new
108113
movements (angles) will get lost as insignificant digits.
109114

110115

@@ -147,13 +152,22 @@ See examples, use with care
147152

148153
## Future
149154

150-
**Should**
151-
- test test and test ...(ESP too)
155+
#### Must
156+
152157
- improve documentation
153-
- look for maths optimizations (atan, hypot, performance)
154158

159+
#### Should
160+
161+
- test test and test ...(ESP too)
162+
163+
#### Could
155164

156-
**Could**
157-
- calibrate function in the lib ? (think not as lib might grow?)
158165
- calibrate sketch could print code snippet to include...
159166

167+
#### Wont
168+
169+
- look for maths optimizations (atan, hypot, performance)
170+
- ==> hypot optimized.
171+
- other ideas affect accuracy, so unless new ideas arise.
172+
- calibrate function in the lib
173+
- not as lib will grow too large.

examples/GY521_angle/GY521_angle.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: GY521_angle.ino
33
// AUTHOR: Rob Tillaart
4-
// PURPOSE: demo pitch roll yaw
4+
// PURPOSE: read angleX, angleY, angleZ
55
// DATE: 2022-06-06
66

77

@@ -29,13 +29,13 @@ void setup()
2929
Serial.println("\tCould not connect to GY521");
3030
delay(1000);
3131
}
32-
sensor.setAccelSensitivity(2); // 8g
33-
sensor.setGyroSensitivity(1); // 500 degrees/s
32+
sensor.setAccelSensitivity(2); // 8g
33+
sensor.setGyroSensitivity(1); // 500 degrees/s
3434

3535
sensor.setThrottle();
3636
Serial.println("start...");
3737

38-
// set calibration values from calibration sketch.
38+
// set calibration values from calibration sketch.
3939
sensor.axe = 0.574;
4040
sensor.aye = -0.002;
4141
sensor.aze = -1.043;
@@ -54,11 +54,11 @@ void loop()
5454

5555
if (counter % 10 == 0)
5656
{
57-
// Serial.println("\nCNT\tX\tY\tZ");
57+
// Serial.println("\nCNT\tX\tY\tZ");
5858
}
5959

60-
//Serial.print(counter);
61-
//Serial.print('\t');
60+
// Serial.print(counter);
61+
// Serial.print('\t');
6262
Serial.print(x, 1);
6363
Serial.print('\t');
6464
Serial.print(y, 1);
@@ -70,5 +70,5 @@ void loop()
7070
}
7171

7272

73-
// -- END OF FILE --
73+
// -- END OF FILE --
7474

examples/GY521_readCalibration_2/GY521_readCalibration_2.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ void setup()
3030
{
3131
Serial.println("Could not connect to GY521");
3232
}
33-
// adjust when needed.
34-
sensor.setAccelSensitivity(0); // 2g
35-
sensor.setGyroSensitivity(0); // 250 degrees/s
33+
// adjust when needed.
34+
sensor.setAccelSensitivity(0); // 2g
35+
sensor.setGyroSensitivity(0); // 250 degrees/s
3636
sensor.setThrottle(false);
3737

38-
// set all calibration errors to zero
38+
// set all calibration errors to zero
3939
sensor.axe = 0;
4040
sensor.aye = 0;
4141
sensor.aze = 0;
@@ -113,7 +113,7 @@ void loop()
113113
Serial.print(t * 0.01, 2);
114114
Serial.println();
115115
}
116-
// adjust calibration errors so table should get all zero's.
116+
// adjust calibration errors so table should get all zero's.
117117
sensor.axe += ax * 0.01;
118118
sensor.aye += ay * 0.01;
119119
sensor.aze += az * 0.01;
@@ -126,4 +126,4 @@ void loop()
126126
}
127127

128128

129-
// -- END OF FILE --
129+
// -- END OF FILE --

examples/GY521_test_1/GY521_test_1.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ void setup()
2929
Serial.println("\tCould not connect to GY521");
3030
delay(1000);
3131
}
32-
sensor.setAccelSensitivity(0); // 2g
33-
sensor.setGyroSensitivity(0); // 250 degrees/s
32+
sensor.setAccelSensitivity(0); // 2g
33+
sensor.setGyroSensitivity(0); // 250 degrees/s
3434

3535
sensor.setThrottle();
3636
Serial.println("start...");
3737

38-
// set calibration values from calibration sketch.
38+
// set calibration values from calibration sketch.
3939
sensor.axe = 0;
4040
sensor.aye = 0;
4141
sensor.aze = 0;
@@ -84,5 +84,5 @@ void loop()
8484
}
8585

8686

87-
// -- END OF FILE --
87+
// -- END OF FILE --
8888

examples/GY521_test_2/GY521_test_2.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void setup()
6666
Serial.println("\tThrot err:\tfalse");
6767
}
6868

69-
for (uint16_t n = 0; n < 1000; n++) // 0 - 1 second.
69+
for (uint16_t n = 0; n < 1000; n++) // 0 - 1 second.
7070
{
7171
sensor.setThrottleTime(n);
7272
if (sensor.getThrottleTime() != n)
@@ -85,5 +85,5 @@ void loop()
8585
}
8686

8787

88-
// -- END OF FILE --
88+
// -- END OF FILE --
8989

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/GY521.git"
1717
},
18-
"version": "0.3.8",
18+
"version": "0.3.9",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

0 commit comments

Comments
 (0)