Skip to content

Commit

Permalink
update readme.md (#44)
Browse files Browse the repository at this point in the history
- update readme.md
- minor edits
  • Loading branch information
RobTillaart authored Nov 2, 2023
1 parent b0a5174 commit fd40f46
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.4.1] - 2023-11-02
- update readme.md
- minor edits


## [0.4.0] - 2023-06-11
- fix #42 roll + pitch "jumps" after full rotation.
- fixed normalization code.
Expand Down
18 changes: 9 additions & 9 deletions GY521.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: GY521.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
// URL: https://github.com/RobTillaart/GY521

Expand Down Expand Up @@ -124,7 +124,7 @@ int16_t GY521::read()

// duration interval
now = micros();
float duration = (now - _lastMicros) * 1e-6; // duration in seconds.
float duration = (now - _lastMicros) * 1e-6; // duration in seconds.
_lastMicros = now;


Expand Down Expand Up @@ -180,7 +180,7 @@ int16_t GY521::read()
// correction at 375 due to the factor 0.96 in pitch
if (_gay >= 375) _gay -= 375;
else if (_gay < 0) _gay += 375;
// correction at 360
// correction at 360
if (_gaz >= 360) _gaz -= 360;
else if (_gaz < 0) _gaz += 360;
}
Expand Down Expand Up @@ -335,7 +335,7 @@ int16_t GY521::readGyro()
// correction at 375 due to the factor 0.96 in pitch
if (_gay >= 375) _gay -= 375;
else if (_gay < 0) _gay += 375;
// correction at 360
// correction at 360
if (_gaz >= 360) _gaz -= 360;
else if (_gaz < 0) _gaz += 360;
}
Expand Down Expand Up @@ -376,7 +376,7 @@ bool GY521::setAccelSensitivity(uint8_t as)
{
return false;
}
// no need to write same value
// no need to write same value
if (((val >> 3) & 3) != _afs)
{
val &= 0xE7;
Expand All @@ -386,7 +386,7 @@ bool GY521::setAccelSensitivity(uint8_t as)
return false;
}
}
// calculate conversion factor. // 4 possible values => lookup table?
// calculate conversion factor. // 4 possible values => lookup table?
_raw2g = (1 << _afs) * GY521_RAW2G;
return true;
}
Expand All @@ -397,7 +397,7 @@ uint8_t GY521::getAccelSensitivity()
uint8_t val = getRegister(GY521_ACCEL_CONFIG);
if (_error != GY521_OK)
{
return _error; // return and propagate error (best thing to do)
return _error; // return and propagate error (best thing to do)
}
_afs = (val >> 3) & 3;
return _afs;
Expand All @@ -423,7 +423,7 @@ bool GY521::setGyroSensitivity(uint8_t gs)
return false;
}
}
// calculate conversion factor..
// calculate conversion factor..
// 4 possible values => lookup table?
_raw2dps = (1 << _gfs) * GY521_RAW2DPS;
return true;
Expand Down Expand Up @@ -487,5 +487,5 @@ int16_t GY521::_WireRead2()
}


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

5 changes: 2 additions & 3 deletions GY521.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
//
// FILE: GY521.h
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor
// URL: https://github.com/RobTillaart/GY521
//


#include "Arduino.h"
#include "Wire.h"


#define GY521_LIB_VERSION (F("0.4.0"))
#define GY521_LIB_VERSION (F("0.4.1"))


// THROTTLE TIMING
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/GY521/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/GY521/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/GY521/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/GY521/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/GY521/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/GY521.svg)](https://github.com/RobTillaart/GY521/issues)

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/GY521/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/GY521.svg?maxAge=3600)](https://github.com/RobTillaart/GY521/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/GY521.svg)](https://registry.platformio.org/libraries/robtillaart/GY521)


# GY521
Expand Down Expand Up @@ -164,19 +167,33 @@ See examples, use with care
#### Must

- improve documentation
- add tables where appropriate
- sensitivity, error codes etc
- test test and test ...(ESP too)


#### Should

- add performance sketch

#### Could

- calibrate sketch could print code snippet to include...
- add examples
- improve unit tests?

#### Wont

- look for maths optimizations (atan, hypot, performance)
- ==> hypot optimized.
- ==> hypot optimized (fastTrig?)
- other ideas affect accuracy, so unless new ideas arise.
- calibrate function in the lib
- not as lib will grow too large.

## Support

If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.

Thank you,

4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/GY521.git"
},
"version": "0.4.0",
"version": "0.4.1",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "GY521.h"
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name=GY521
version=0.4.0
version=0.4.1
author=Rob Tillaart <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=Arduino library for GY521 angle measurement
paragraph=
category=Sensors
url=https://github.com/RobTillaart/GY521
architectures=*
includes=GY521.h
includes=GY521.h
depends=

0 comments on commit fd40f46

Please sign in to comment.