Skip to content

Commit

Permalink
update github actions (#38)
Browse files Browse the repository at this point in the history
- update GitHub actions
- update license 2023
- edit changelog.md
- update readme.md
- minor edits
  • Loading branch information
RobTillaart authored Jan 27, 2023
1 parent 3d99d0b commit 75b4252
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 73 deletions.
33 changes: 13 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.3.8] - 2022-10-07

## [0.3.9] - 2023-01-27
- update GitHub actions
- update license 2023
- edit changelog.md
- update readme.md
- minor edits


## [0.3.8] - 2022-10-07
- added CHANGELOG.md
- fix #36 - limit values of pitch() roll() yaw() to 0..360 range.
- rename three constants, move to .h.
Expand All @@ -16,83 +24,68 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- updated documentation a bit.

## [0.3.7] - 2022-07-26

- add partial reads readAccel(), readGyro() and readTemperature()
- rename + add GY521_LIB_VERSION to examples.

## [0.3.6] - 2021-12-18

- update library.json, license, minor edits

## [0.3.5] - 2021-10-20

- update build-CI, badges
- fix #28 add wakeup to begin().

## [0.3.4] - 2021-07-12

- fix #24 improve precision

## [0.3.3] - 2021-07-05

- fix #22 improve maths

## [0.3.2] - 2021-07-05

- fix #20 support multiWire

## [0.3.1] - 2021-06-13

- added more unit test
- some initialization

## [0.3.0] - 2021-04-07

- fix #18 acceleration error correction (kudo's to Merkxic)

## [0.2.3] - 2021-01-26
----

## [0.2.3] - 2021-01-26
- align version numbers (oops)

## [0.2.2] - 2021-01-24

- add interface part to readme.md
- add GY521_registers.h

## [0.2.1] - 2020-12-24

- add Arduino-CI build
- add unit tests

## [0.2.0] - 2020-11-03

- improve error handling

## [0.1.5] - 2020-09-29
----

## [0.1.5] - 2020-09-29
- fix #6 fix maths for Teensy

## [0.1.4] - 2020-09-29

- fix #5 missing ;

## [0.1.3] - 2020-08-07

- fix ESP support
- add pitch roll yaw demo

## [0.1.2] - 2020-08-06

- fix setAccelSensitivity
- add getters

## [0.1.1] - 2020-07-09

- refactor
- initial release

## [0.1.0] - 2017-11-20

- initial version


2 changes: 1 addition & 1 deletion GY521.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: GY521.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.3.8
// VERSION: 0.3.9
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
// URL: https://github.com/RobTillaart/GY521

Expand Down
10 changes: 5 additions & 5 deletions GY521.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: GY521.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.8
// VERSION: 0.3.9
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
// URL: https://github.com/RobTillaart/GY521
//
Expand All @@ -12,12 +12,12 @@
#include "Wire.h"


#define GY521_LIB_VERSION (F("0.3.8"))
#define GY521_LIB_VERSION (F("0.3.9"))


// THROTTLE TIMING
#ifndef GY521_THROTTLE_TIME
#define GY521_THROTTLE_TIME 10 // milliseconds
#define GY521_THROTTLE_TIME 10 // milliseconds
#endif


Expand All @@ -38,7 +38,7 @@
class GY521
{
public:
GY521(uint8_t address = 0x69, TwoWire *wire = &Wire); // 0x68 or 0x69
GY521(uint8_t address = 0x69, TwoWire *wire = &Wire); // 0x68 or 0x69


#if defined (ESP8266) || defined(ESP32)
Expand Down Expand Up @@ -140,4 +140,4 @@ class GY521
};


// -- END OF FILE --
// -- END OF FILE --
4 changes: 2 additions & 2 deletions GY521_registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//


// keep names in sync with BIG MPU6050 lib
// keep names in sync with BIG MPU6050 lib


#define GY521_XG_OFFS_TC 0x00
Expand Down Expand Up @@ -141,5 +141,5 @@
#define GY521_WHO_AM_I 0x75


// -- END OF FILE --
// -- END OF FILE --

58 changes: 36 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,29 @@ It needs to be tested a lot more.

#### Examples

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


## Breakout board

From left to right

| pin | pinName | description |
|:----:|:--------|:----------------|
| 0 | VCC | +5V |
| 1 | GND | ground |
| 2 | SCL | I2C clock |
| 3 | SDA | I2C data |
| 4 | XDA | auxiliary data | see datasheet
| 5 | XCL | auxiliary clock | see datasheet
| 6 | AD0 | address |
| 7 | INT | interrupt |
| pin | pinName | description | notes |
|:-----:|:---------:|:------------------|:-------:|
| 0 | VCC | +5V |
| 1 | GND | ground |
| 2 | SCL | I2C clock |
| 3 | SDA | I2C data |
| 4 | XDA | auxiliary data | see datasheet
| 5 | XCL | auxiliary clock | see datasheet
| 6 | AD0 | address |
| 7 | INT | interrupt |


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

## Interface

```cpp
#include "GY521.h"
```

### Constructor

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


### READ
### Read

#### Set before read

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

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


Expand Down Expand Up @@ -147,13 +152,22 @@ See examples, use with care

## Future

**Should**
- test test and test ...(ESP too)
#### Must

- improve documentation
- look for maths optimizations (atan, hypot, performance)

#### Should

- test test and test ...(ESP too)

#### Could

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

#### Wont

- look for maths optimizations (atan, hypot, performance)
- ==> hypot optimized.
- other ideas affect accuracy, so unless new ideas arise.
- calibrate function in the lib
- not as lib will grow too large.
16 changes: 8 additions & 8 deletions examples/GY521_angle/GY521_angle.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: GY521_angle.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo pitch roll yaw
// PURPOSE: read angleX, angleY, angleZ
// DATE: 2022-06-06


Expand Down Expand Up @@ -29,13 +29,13 @@ void setup()
Serial.println("\tCould not connect to GY521");
delay(1000);
}
sensor.setAccelSensitivity(2); // 8g
sensor.setGyroSensitivity(1); // 500 degrees/s
sensor.setAccelSensitivity(2); // 8g
sensor.setGyroSensitivity(1); // 500 degrees/s

sensor.setThrottle();
Serial.println("start...");

// set calibration values from calibration sketch.
// set calibration values from calibration sketch.
sensor.axe = 0.574;
sensor.aye = -0.002;
sensor.aze = -1.043;
Expand All @@ -54,11 +54,11 @@ void loop()

if (counter % 10 == 0)
{
// Serial.println("\nCNT\tX\tY\tZ");
// Serial.println("\nCNT\tX\tY\tZ");
}

//Serial.print(counter);
//Serial.print('\t');
// Serial.print(counter);
// Serial.print('\t');
Serial.print(x, 1);
Serial.print('\t');
Serial.print(y, 1);
Expand All @@ -70,5 +70,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

12 changes: 6 additions & 6 deletions examples/GY521_readCalibration_2/GY521_readCalibration_2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ void setup()
{
Serial.println("Could not connect to GY521");
}
// adjust when needed.
sensor.setAccelSensitivity(0); // 2g
sensor.setGyroSensitivity(0); // 250 degrees/s
// adjust when needed.
sensor.setAccelSensitivity(0); // 2g
sensor.setGyroSensitivity(0); // 250 degrees/s
sensor.setThrottle(false);

// set all calibration errors to zero
// set all calibration errors to zero
sensor.axe = 0;
sensor.aye = 0;
sensor.aze = 0;
Expand Down Expand Up @@ -113,7 +113,7 @@ void loop()
Serial.print(t * 0.01, 2);
Serial.println();
}
// adjust calibration errors so table should get all zero's.
// adjust calibration errors so table should get all zero's.
sensor.axe += ax * 0.01;
sensor.aye += ay * 0.01;
sensor.aze += az * 0.01;
Expand All @@ -126,4 +126,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
8 changes: 4 additions & 4 deletions examples/GY521_test_1/GY521_test_1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ void setup()
Serial.println("\tCould not connect to GY521");
delay(1000);
}
sensor.setAccelSensitivity(0); // 2g
sensor.setGyroSensitivity(0); // 250 degrees/s
sensor.setAccelSensitivity(0); // 2g
sensor.setGyroSensitivity(0); // 250 degrees/s

sensor.setThrottle();
Serial.println("start...");

// set calibration values from calibration sketch.
// set calibration values from calibration sketch.
sensor.axe = 0;
sensor.aye = 0;
sensor.aze = 0;
Expand Down Expand Up @@ -84,5 +84,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

4 changes: 2 additions & 2 deletions examples/GY521_test_2/GY521_test_2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void setup()
Serial.println("\tThrot err:\tfalse");
}

for (uint16_t n = 0; n < 1000; n++) // 0 - 1 second.
for (uint16_t n = 0; n < 1000; n++) // 0 - 1 second.
{
sensor.setThrottleTime(n);
if (sensor.getThrottleTime() != n)
Expand All @@ -85,5 +85,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/GY521.git"
},
"version": "0.3.8",
"version": "0.3.9",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
Expand Down
Loading

0 comments on commit 75b4252

Please sign in to comment.