diff --git a/CHANGELOG.md b/CHANGELOG.md index fd95278..a26d1d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - refactor API, begin() - update readme.md - update examples +- add examples - patch library.properties => category=Sensors ---- diff --git a/examples/AS5600_demo_RP2040/AS5600_demo_RP2040.ino b/examples/AS5600_demo_RP2040/AS5600_demo_RP2040.ino index bc13a94..49ac9dc 100644 --- a/examples/AS5600_demo_RP2040/AS5600_demo_RP2040.ino +++ b/examples/AS5600_demo_RP2040/AS5600_demo_RP2040.ino @@ -19,7 +19,7 @@ void setup() Wire.setSDA(14); Wire.setSCL(15); - Wire.begin() + Wire.begin(); as5600.begin(4); // set direction pin. as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit. diff --git a/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino b/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino index eeb2f6e..da3823d 100644 --- a/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino +++ b/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino @@ -19,7 +19,7 @@ void setup() Wire.begin(14, 15); // ESP32 - as5600.begin(): + as5600.begin(); as5600.setAddress(0x40); // AS5600L has address as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit. diff --git a/test/unit_test_001.cpp b/test/unit_test_001.cpp index 913b963..26bb999 100644 --- a/test/unit_test_001.cpp +++ b/test/unit_test_001.cpp @@ -111,6 +111,9 @@ unittest(test_constants_configuration) unittest(test_constructor) { AS5600 as5600; + + Wire.begin(); + as5600.begin(4); assertTrue(as5600.isConnected()); // keep CI happy @@ -123,6 +126,9 @@ unittest(test_constructor) unittest(test_address) { AS5600 as5600; + + Wire.begin(); + as5600.begin(4); assertEqual(0x36, as5600.getAddress()); @@ -140,6 +146,8 @@ unittest(test_hardware_direction) { AS5600 as5600; + Wire.begin(); + as5600.begin(4); assertEqual(AS5600_CLOCK_WISE, as5600.getDirection()); @@ -158,6 +166,8 @@ unittest(test_software_direction) { AS5600 as5600; + Wire.begin(); + as5600.begin(255); assertEqual(AS5600_CLOCK_WISE, as5600.getDirection()); @@ -176,6 +186,8 @@ unittest(test_offset) { AS5600 as5600; + Wire.begin(); + as5600.begin(); for (int of = 0; of < 360; of += 40) @@ -202,6 +214,8 @@ unittest(test_failing_set_commands) { AS5600 as5600; + Wire.begin(); + as5600.begin(); assertFalse(as5600.setZPosition(4096)); @@ -219,7 +233,7 @@ unittest(test_failing_set_commands) } -// FOR REMAINING ONE NEED A STUB +// FOR REMAINING ONE NEED A STUB unittest_main()