diff --git a/libraries/GY521/GY521.cpp b/libraries/GY521/GY521.cpp index 7fc9c0c3..af7f859e 100644 --- a/libraries/GY521/GY521.cpp +++ b/libraries/GY521/GY521.cpp @@ -1,7 +1,7 @@ // // FILE: GY521.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.4 +// VERSION: 0.3.6 // PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor // URL: https://github.com/RobTillaart/GY521 // @@ -23,6 +23,7 @@ // 0.3.3 2021-07-05 fix #22 improve maths // 0.3.4 2021-07-12 fix #24 improve precision // 0.3.5 2021-10-20 update build-CI, badges + #28 add wakeup to begin(). +// 0.3.6 2021-12-18 update library.json, license, minor edits #include "GY521.h" @@ -317,3 +318,4 @@ int16_t GY521::_WireRead2() // -- END OF FILE -- + diff --git a/libraries/GY521/GY521.h b/libraries/GY521/GY521.h index 0785b2f8..3827385a 100644 --- a/libraries/GY521/GY521.h +++ b/libraries/GY521/GY521.h @@ -2,7 +2,7 @@ // // FILE: GY521.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.4 +// VERSION: 0.3.6 // PURPOSE: Arduino library for I2C GY521 accelerometer-gyroscope sensor // URL: https://github.com/RobTillaart/GY521 // @@ -15,7 +15,7 @@ #include "Wire.h" -#define GY521_LIB_VERSION (F("0.3.5")) +#define GY521_LIB_VERSION (F("0.3.6")) #ifndef GY521_THROTTLE_TIME diff --git a/libraries/GY521/GY521_registers.h b/libraries/GY521/GY521_registers.h index fe92d0dd..81dc4e17 100644 --- a/libraries/GY521/GY521_registers.h +++ b/libraries/GY521/GY521_registers.h @@ -140,4 +140,6 @@ #define GY521_FIFO_R_W 0x74 #define GY521_WHO_AM_I 0x75 + // -- END OF FILE -- + diff --git a/libraries/GY521/LICENSE b/libraries/GY521/LICENSE index d29d575f..4231b05c 100644 --- a/libraries/GY521/LICENSE +++ b/libraries/GY521/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2021 Rob Tillaart +Copyright (c) 2017-2022 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/libraries/GY521/README.md b/libraries/GY521/README.md index b23a3dc5..8ecb8f31 100644 --- a/libraries/GY521/README.md +++ b/libraries/GY521/README.md @@ -5,14 +5,15 @@ [![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) + # GY521 -Arduino library for I2C GY521 accelerometer-gyroscope sensor a.k.a. MCU-6050 +Arduino library for I2C GY521 accelerometer-gyroscope sensor a.k.a. MCU-6050. ## Description -Experimental library for GY521 a.k.a. MCU-6050 +Experimental library for GY521 a.k.a. MCU-6050. Library is work in progress, in fact it is extracted and extended from an old project. It needs to be tested a lot more. @@ -68,7 +69,7 @@ AD0 connected to VCC => 0x69 - **bool begin()** Returns true if address can be found on I2C bus. - **bool isConnected()** returns true if device can be found on I2C bus. - **void reset()** set all internal values to 0 and throttle time to 10 ms. -- **bool wakeUp()** +- **bool wakeUp()** idem. ### Throttle @@ -122,6 +123,16 @@ Read the register PDF for the specific value and meaning of registers. - **uint8_t getRegister(uint8_t reg)** +## documents + +- check details - MPU-6000-Register-Map1.pdf + + +## Operation + +See examples, use with care + + ## Future **Should** @@ -135,13 +146,3 @@ Read the register PDF for the specific value and meaning of registers. - calibrate sketch could print code snippet to include... - option to read only Accel? - option to read only Gyro? - -## documents - -- check details - MPU-6000-Register-Map1.pdf - - -## Operation - -See examples, use with care - diff --git a/libraries/GY521/examples/GY521_performance/GY521_performance.ino b/libraries/GY521/examples/GY521_performance/GY521_performance.ino index f3388c1c..0463701c 100644 --- a/libraries/GY521/examples/GY521_performance/GY521_performance.ino +++ b/libraries/GY521/examples/GY521_performance/GY521_performance.ino @@ -1,7 +1,6 @@ // // FILE: GY521_performance.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 // PURPOSE: minimal demo // DATE: 2021-06-13 @@ -44,4 +43,6 @@ void loop() delay(1000); } -// -- END OF FILE -- \ No newline at end of file + +// -- END OF FILE -- + diff --git a/libraries/GY521/examples/GY521_pitch_roll_yaw/GY521_pitch_roll_yaw.ino b/libraries/GY521/examples/GY521_pitch_roll_yaw/GY521_pitch_roll_yaw.ino index a99e714e..e27f40eb 100644 --- a/libraries/GY521/examples/GY521_pitch_roll_yaw/GY521_pitch_roll_yaw.ino +++ b/libraries/GY521/examples/GY521_pitch_roll_yaw/GY521_pitch_roll_yaw.ino @@ -1,8 +1,7 @@ // // FILE: GY521_pitch_roll_yaw.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 -// PURPOSE: demo PRY +// PURPOSE: demo pitch roll yaw // DATE: 2020-08-06 @@ -32,7 +31,7 @@ void setup() sensor.setThrottle(); Serial.println("start..."); - + // set calibration values from calibration sketch. sensor.axe = 0; sensor.aye = 0; diff --git a/libraries/GY521/examples/readCalibration/readCalibration.ino b/libraries/GY521/examples/readCalibration/readCalibration.ino index 2107c40b..b1c75a97 100644 --- a/libraries/GY521/examples/readCalibration/readCalibration.ino +++ b/libraries/GY521/examples/readCalibration/readCalibration.ino @@ -1,7 +1,6 @@ // // FILE: readCalibration.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 // PURPOSE: read the calibration values / errors for a flat sensor. // DATE: 2020-07-14 @@ -105,7 +104,7 @@ void loop() sensor.gxe += gx * 0.05; sensor.gye += gy * 0.05; sensor.gze += gz * 0.05; - + counter++; delay(100); } diff --git a/libraries/GY521/examples/test1/test1.ino b/libraries/GY521/examples/test1/test1.ino index a42a8dc7..e7fadb90 100644 --- a/libraries/GY521/examples/test1/test1.ino +++ b/libraries/GY521/examples/test1/test1.ino @@ -1,8 +1,7 @@ // // FILE: test1.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 -// PURPOSE: minimal demo +// PURPOSE: minimal demo to test working of the sensor. // DATE: 2020-07-01 @@ -42,6 +41,7 @@ void setup() sensor.gze = 0; } + void loop() { sensor.read(); diff --git a/libraries/GY521/examples/test_2/test_2.ino b/libraries/GY521/examples/test_2/test_2.ino index 6d6d81e0..656a7994 100644 --- a/libraries/GY521/examples/test_2/test_2.ino +++ b/libraries/GY521/examples/test_2/test_2.ino @@ -1,8 +1,7 @@ // // FILE: test_2.ino // AUTHOR: Rob Tillaart -// VERSION: 0.1.0 -// PURPOSE: test set/get +// PURPOSE: test set/get functions // DATE: 2020-08-06 diff --git a/libraries/GY521/keywords.txt b/libraries/GY521/keywords.txt index 2bca44c9..fe2f4b25 100644 --- a/libraries/GY521/keywords.txt +++ b/libraries/GY521/keywords.txt @@ -1,8 +1,10 @@ -# Syntax Coloring Map for GY521 +# Syntax Colouring Map for GY521 -# Datatypes (KEYWORD1) + +# Data types (KEYWORD1) GY521 KEYWORD1 + # Methods and Functions (KEYWORD2) begin KEYWORD2 isConnected KEYWORD2 @@ -39,6 +41,7 @@ setRegister KEYWORD2 getRegister KEYWORD2 getError KEYWORD2 + # Constants (LITERAL1) GY521_LIB_VERSION LITERAL1 GY521_THROTTLE_TIME LITERAL1 diff --git a/libraries/GY521/library.json b/libraries/GY521/library.json index dedac82e..b85456de 100644 --- a/libraries/GY521/library.json +++ b/libraries/GY521/library.json @@ -15,8 +15,9 @@ "type": "git", "url": "https://github.com/RobTillaart/GY521.git" }, - "version": "0.3.5", + "version": "0.3.6", "license": "MIT", "frameworks": "arduino", - "platforms": "*" + "platforms": "*", + "headers": "GY521.h" } diff --git a/libraries/GY521/library.properties b/libraries/GY521/library.properties index 8249d8d4..c0e90094 100644 --- a/libraries/GY521/library.properties +++ b/libraries/GY521/library.properties @@ -1,5 +1,5 @@ name=GY521 -version=0.3.5 +version=0.3.6 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for GY521 angle measurement diff --git a/libraries/GY521/test/unit_test_001.cpp b/libraries/GY521/test/unit_test_001.cpp index f5861427..e66b1d06 100644 --- a/libraries/GY521/test/unit_test_001.cpp +++ b/libraries/GY521/test/unit_test_001.cpp @@ -31,6 +31,7 @@ unittest_setup() { + fprintf(stderr, "GY521_LIB_VERSION: %s\n", (char *) GY521_LIB_VERSION); } @@ -42,7 +43,7 @@ unittest_teardown() unittest(test_constructor) { GY521 sensor(0x69); - fprintf(stderr, "VERSION: %s\n", (char *) GY521_LIB_VERSION); + sensor.begin(); assertEqual(GY521_OK, sensor.getError()); @@ -97,8 +98,6 @@ unittest(test_get_set_sensitivity) unittest(test_constants) { - fprintf(stderr, "VERSION: %s\n", (char *) GY521_LIB_VERSION); - assertEqual(GY521_OK, 0); assertEqual(GY521_THROTTLED, 1); assertEqual(GY521_ERROR_READ, -1);