Skip to content

Commit 8eea2d1

Browse files
committed
0.3.5 GY521
1 parent 7c46024 commit 8eea2d1

File tree

12 files changed

+56
-16
lines changed

12 files changed

+56
-16
lines changed

libraries/GY521/.arduino-ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ compile:
22
# Choosing to run compilation tests on 2 different Arduino platforms
33
platforms:
44
- uno
5-
- leonardo
6-
- due
7-
- zero
5+
# - due
6+
# - zero
7+
# - leonardo
8+
- m4
9+
- esp32
10+
# - esp8266
11+
# - mega2560

libraries/GY521/.github/workflows/arduino_test_runner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ name: Arduino CI
44
on: [push, pull_request]
55

66
jobs:
7-
arduino_ci:
7+
runTest:
88
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: Arduino-CI/action@master
13-
# Arduino-CI/[email protected]
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- run: |
16+
gem install arduino_ci
17+
arduino_ci.rb

libraries/GY521/GY521.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// 0.3.2 2021-07-05 fix #20 support multiWire
2323
// 0.3.3 2021-07-05 fix #22 improve maths
2424
// 0.3.4 2021-07-12 fix #24 improve precision
25+
// 0.3.5 2021-10-20 update build-CI, badges + #28 add wakeup to begin().
2526

2627

2728
#include "GY521.h"
@@ -52,15 +53,23 @@ GY521::GY521(uint8_t address, TwoWire *wire)
5253
bool GY521::begin(uint8_t sda, uint8_t scl)
5354
{
5455
_wire->begin(sda, scl);
55-
return isConnected();
56+
if (isConnected())
57+
{
58+
return wakeup();
59+
}
60+
return false;
5661
}
5762
#endif
5863

5964

6065
bool GY521::begin()
6166
{
6267
_wire->begin();
63-
return isConnected();
68+
if (isConnected())
69+
{
70+
return wakeup();
71+
}
72+
return false;
6473
}
6574

6675

libraries/GY521/GY521.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "Wire.h"
1616

1717

18-
#define GY521_LIB_VERSION (F("0.3.4"))
18+
#define GY521_LIB_VERSION (F("0.3.5"))
1919

2020

2121
#ifndef GY521_THROTTLE_TIME

libraries/GY521/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
[![Arduino CI](https://github.com/RobTillaart/GY521/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
3+
[![Arduino-lint](https://github.com/RobTillaart/GY521/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/GY521/actions/workflows/arduino-lint.yml)
4+
[![JSON check](https://github.com/RobTillaart/GY521/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/GY521/actions/workflows/jsoncheck.yml)
35
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/GY521/blob/master/LICENSE)
46
[![GitHub release](https://img.shields.io/github/release/RobTillaart/GY521.svg?maxAge=3600)](https://github.com/RobTillaart/GY521/releases)
57

libraries/GY521/examples/GY521_pitch_roll_yaw/GY521_pitch_roll_yaw.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
// PURPOSE: demo PRY
66
// DATE: 2020-08-06
77

8+
89
#include "GY521.h"
910

1011
GY521 sensor(0x69);
1112

1213
uint32_t counter = 0;
1314

15+
1416
void setup()
1517
{
1618
Serial.begin(115200);
@@ -31,7 +33,7 @@ void setup()
3133
sensor.setThrottle();
3234
Serial.println("start...");
3335

34-
// set callibration values from calibration sketch.
36+
// set calibration values from calibration sketch.
3537
sensor.axe = 0;
3638
sensor.aye = 0;
3739
sensor.aze = 0;
@@ -40,6 +42,7 @@ void setup()
4042
sensor.gze = 0;
4143
}
4244

45+
4346
void loop()
4447
{
4548
sensor.read();
@@ -64,4 +67,6 @@ void loop()
6467
counter++;
6568
}
6669

70+
6771
// -- END OF FILE --
72+

libraries/GY521/examples/readCalibration/readCalibration.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// PURPOSE: read the calibration values / errors for a flat sensor.
66
// DATE: 2020-07-14
77

8+
89
#include "GY521.h"
910

1011
GY521 sensor(0x69);
@@ -15,6 +16,7 @@ float ax, ay, az;
1516
float gx, gy, gz;
1617
float t;
1718

19+
1820
void setup()
1921
{
2022
Serial.begin(115200);
@@ -31,7 +33,7 @@ void setup()
3133
sensor.setGyroSensitivity(0); // 250 degrees/s
3234
sensor.setThrottle(false);
3335

34-
// set all callibration errors to zero
36+
// set all calibration errors to zero
3537
sensor.axe = 0;
3638
sensor.aye = 0;
3739
sensor.aze = 0;
@@ -42,6 +44,7 @@ void setup()
4244
Serial.println("\n\nReading calibration numbers...");
4345
}
4446

47+
4548
void loop()
4649
{
4750
ax = ay = az = 0;
@@ -107,4 +110,6 @@ void loop()
107110
delay(100);
108111
}
109112

113+
110114
// -- END OF FILE --
115+

libraries/GY521/examples/test1/test1.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
// PURPOSE: minimal demo
66
// DATE: 2020-07-01
77

8+
89
#include "GY521.h"
910

1011
GY521 sensor(0x69);
1112

1213
uint32_t counter = 0;
1314

15+
1416
void setup()
1517
{
1618
Serial.begin(115200);
@@ -31,7 +33,7 @@ void setup()
3133
sensor.setThrottle();
3234
Serial.println("start...");
3335

34-
// set callibration values from calibration sketch.
36+
// set calibration values from calibration sketch.
3537
sensor.axe = 0;
3638
sensor.aye = 0;
3739
sensor.aze = 0;
@@ -78,4 +80,6 @@ void loop()
7880
delay(1000);
7981
}
8082

83+
8184
// -- END OF FILE --
85+

libraries/GY521/examples/test_2/test_2.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
// PURPOSE: test set/get
66
// DATE: 2020-08-06
77

8+
89
#include "GY521.h"
910

1011
GY521 sensor(0x69);
1112

13+
1214
void setup()
1315
{
1416
Serial.begin(115200);
@@ -75,8 +77,11 @@ void setup()
7577
Serial.println("\nDone...");
7678
}
7779

80+
7881
void loop()
7982
{
8083
}
8184

85+
8286
// -- END OF FILE --
87+

libraries/GY521/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.4",
18+
"version": "0.3.5",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*"

0 commit comments

Comments
 (0)