1.4.1 (28/6/25)

Mainly added stability fixes to the changes added in 1.4.0.

There may be more fixes to come, as we've witnessed occasional issues with drivebase movements after sustained use, but haven't been able to recreate them reliably or determine cause.

If the issues do crop up again, we'll find and fix them swiftly.

1.4.0 (27/6/25)

-- Features --
EVNMotor, EVNDrivebase: Improvements made to position hold! Previously, all hold stop actions and hold() set the motor to hold its position, but did not wait for the motor to settle on its position before returning/completing. Now, it can do that (tolerances and timeout durations can be set in src\evn_motor_defs.h)

EVNMotor: Automatic max RPM adjustments! We noticed that our drivebase turns were getting less accurate as the battery discharged, as the motors could not hit the same speeds at lower voltages. Now, the max RPMs are automatically adjusted to account for battery charge levels on boot.

-- BREAKING Changes --
EVNMotor, EVNAlpha: EVNMotor's begin() (called on 2nd core) will now wait indefinitely for EVNAlpha's begin() to complete on the 1st core before executing. This is done to allow EVNAlpha to take a battery voltage reading for EVNMotor. If your program runs EVNAlpha and EVNMotor on the same core (although we don't recommend it), make sure EVNAlpha is initialized first.

EVNMotor: setMaxRPM() now takes in 2 parameters, unloaded_max_rpm (same as before) and an optional loaded_max_rpm.

1.3.8 (19/5/25)

-- Features --
EVNMotor: getMaxDPS() function added, for easier setting of runSpeed() parameters

-- Bugfixes --
EVNDrivebase: All stop actions (braking, coasting and position hold) should be more responsive (or less "laggy") now

1.3.7 (15/5/25)

-- Bugfixes --
EVNDrivebase: Fix bug where drivePct only turns robot anti-clockwise

1.3.6 (14/5/25)

-- Bugfixes --
EVNMotor, EVNDrivebase: Fix bug where derivative component of PID controller was zeroed out (oops)
EVNDrivebase: Fix incorrect drivePct logic

1.3.5 (7/5/25)

-- Bugfixes --
EVNDrivebase: Fix bug where hold() moves to incorrect setpoint when called immediately after calling individual EVNMotor functions on the drivebase motors.

1.3.4 (11/3/25)

-- Bugfixes --
EVNServo, EVNContinuousServo: Fixed bug where when object is started on core 0, write() on core 0 runs indefinitely.

1.3.3 (16/2/25)

-- Improvements --

EVNDrivebase: Improvements to internal controllers, which should improve response of drivebase

1.3.2 (15/1/25)

-- Improvements --

EVNAlpha: Minor improvements to thread safety

-- Bugfixes --

EVNMotor, EVNDrivebase: Bug where begin() fails to execute should be fully squashed now

1.3.1 (13/1/25)

-- Bugfixes(?) --

EVNMotor, EVNDrivebase: Re-engineered fix for previous bug where begin() failed to execute properly, since begin() still seems to fail occasionally in a hard-to-recreate manner. If this issue is still present, we'll continue investigating.

1.3.0 (3/1/25)

Happy new year!

-- Features --

EVNMotor, EVNDrivebase: Lots of under-the-hood improvements. We've optimized some of the math running on core 1 and sped up our control loops, which should allow for more responsive drivebase movements. We also sped up our core synchronization mechanism, so core 0 is not significantly slowed down by function calls. Finally, we added many more settings functions, which will be documented later (but soon!)

-- Bugfixes --

EVNMotor, EVNDrivebase: Bug where EVNDrivebase functions behaves erratically when called after an EVNMotor function fixed

1.2.2 (20/12/24)

-- Features --

EVNDrivebase: Even after drivebase is instantiated, EVNMotor functions can now be called on the drivebase motors! Doing so while EVNDrivebase commands are running will automatically brake the drivebase, before carrying out the given EVNotor command. Likewise, calling EVNDrivebase commands while an EVNMotor command is running will brake the drivebase before performing the command.

-- Bugfixes --

EVNDrivebase: Fixed bug where drivebase seems to be unresponsive at low turning rates (particularly evident when running drivePct() with sub-1% turning rate)

-- Breaking Changes --

EVNMotor: setMode() function removed
EVNDrivebase: setMode() function removed

1.2.1 (18/12/24)

More breaking changes...we'll try to keep them to a minimum in the future.

On the bright side, the re-tuned motor and drivebase profiles have been added! We're working on a possible auto-tuner and of course, a relevant guide for 3rd party motors.

-- Features --

EVNMotor, EVNDrivebase: We've tuned the motor profiles to have better performance, and added a bunch more helper functions as well.

EVNColourSensor: New functions for reading raw values in % were added, and new versions of all reading functions were added; these new versions can receive colour as an input were added, so the same function can be used to read different colour channels or HSV components.

-- BREAKING Changes --

EVNColourSensor: readXXNorm() functions now return a range of values from 0-100, instead of 0-1

EVNServo, EVNContinuousServo: end() has been renamed to setMode()

-- Bugfixes --

EVNMotor: Fixed inaccurate DPS measurements given by getSpeed() - missed this bug since it does not affect the motor's movements

EVNColourSensor: readHue(), readSaturation(), and readValue() were named as such in the docs, but not in code; code has been changed to reflect docs properly. writeSettings() was also in docs but not in code; it has been removed from docs.

EVNServo: Issue with servo returning to original position once sweep is finished has been fixed

1.2.0 (08/12/24)

In this update, we've made several changes (some of them breaking) to the sensor classes in the hopes of making them more approachable for end-users, despite the many sensor settings options made available for them. Additionally, this update fixes urgent bugs for EVNDrivebase (on the latest versions of the Arduino-Pico core) and EVNContinuousServo.

Currently, we're working on obtaining better PID tunings for EVNMotor and EVNDrivebase for better line-tracking performance. Expect that sometime soon :)

-- Features --

EVNColourSensor, EVNCompassSensor, EVNGestureSensor, EVNIMUSensor, EVNEnvSensor:

For these classes, we adopted the convention of using enums in the class as inputs to set sensor settings (e.g. EVNColourSensor::gain::X4). Given the sheer number of settings, the lengthy wording and possible confusion of using enums, we have decided to add #defines that abbreviate the enums into shorter, simpler terms for the user to pass as input.

For instance, for EVNColourSensor, instead of calling sensor.setGain(EVNColourSensor::gain::X1), the user may now sensor.setGain(COLOUR_GAIN_X1), which is shorter and less confusing.

These additions will not break existing code; the #defines will get converted to the enums during compilation. However, there are some changes or removals of certain enums that will break existing code, detailed more closely below.

-- Changes --

EVNMotor: The behaviour of runAngle() when given negative inputs has been standardised and clarified in docs
EVNDrivebase: The behaviour of curve(), curveTurnRate() and straight() when given negative inputs has been standardised and clarified in docs
EVNIMUSensor: Constructor now contains 3 additional input parameters for sensor settings
EVNEnvSensor: Constructor now contains 5 additional input parameters for sensor settings (docs were previously outdated)

-- BREAKING Changes --
EVNCompassSensor: hmc_samples and qmc_samples enums have been renamed to hmc_sampling and qmc_sampling. This will break existing code that sets the sensor sampling rate, and should be changed to use the newly added #defines.
EVNCompassSensor: setSamplesQMC() and setSamplesHMC() renamed to setSamplingRateQMC() and setSamplingRateHMC() respectively
EVNCompassSensor: setModeQMC() and setModeHMC() combined into one function setMode()

EVNCompassSensor, EVNEnvSensor: setMode() now receives a boolean (instead of enum) indicating whether to enable/disable measurement. This will break existing code that sets sensor mode, and should be changed to use booleans instead.

-- Bugfixes --

EVNDrivebase: Fixed bug for Arduino-Pico >=4.3.0 where begin() would crash
EVNContinuousServo: Fixed compilation errors

1.1.3 (14/11/24)

-- Bugfixes --

EVNMotor: PID tunings for NXT and EV3 Motors improved. Hold is now much more stable as well, with lower settling time and less glitches.

EVNDrivebase: 

Previously, if drive functions were called right after the stop/coast/hold functions, EVNDrivebase would encounter sudden jerks, some of them prolonged.

This occurs because the controllers are unable to properly control the motors mid-pause. This issue has been rectified with a "stop-check", which ensures that after stop commands are issued, the controller will not begin further commands until the motors have actually stopped.

During the stop-check, EVNDrivebase can still receive commands from the user, but it will just start performing those commands when the stop-check is done. Drive-to-endpoint positions with wait enabled and stop/coast/hold functions will also stall the main core until the drivebase has paused or the stop check times out (conversely, drive forever, drive-to-endpoint with no wait enabled will not).

The stop check thresholds and timeout values being configurable in src/evn_motor_defs.h. We hope this will significantly improve your EVN experience :)

1.1.2 (10/11/24)

-- Bugfixes --

EVNDrivebase: PID tunings changed to make the class more usable for NXT and EV3 Large Motors. Completion thresholds for drive-to-endpoint functions have also been relaxed (1deg allowable error to 2deg). Expect better tunings in the near future!

1.1.1 (9/11/24)

-- Features --

EVNDrivebase: drivePct() function has been added! See docs for more info. straight() and curveXXX() functions should also have greater accuracy upon completion.

-- Bugfixes --

EVNDrivebase: Fixed crucial bugs where straight and curveXXX functions would fail to complete or glitch for several seconds with major incorrect movements

EVNColourSensor: In docs, some functions were named incorrectly. They have been rectified since.

1.1.0 (22/10/24)

-- Bugfixes --

EVNGestureSensor: Fixed bug where colour readings were accidentally constrained to 8-bit value. 

EVNGestureSensor: Discovered sensor issue where gesture mode causes colour and proximity modes to fail under certain conditions. This is not a bug but rather part of the sensor's design. Docs have been updated to communicate this more clearly and library has been updated for more convenience when switching between modes.

-- Features --

EVNRGBLED, EVNServo, EVNContinuousServo: end() function added. Calling this function releases any PIO state machines consumed by the objects.

EVNRGBLED: This class now uses the RP2040's DMA peripherals to transfer data to the RGB LEDs, greatly reducing the execution time for update() on the main CPU core.

1.0.2 (22/09/24)

-- Bugfixes --

EVNMotor, EVNDrivebase: Fix important bug where encoder pulses were skipped, leading to inaccurate encoder readings and sudden changes in motor direction when running, especially when using EVNDrivebase

1.0.1 (22/09/24)

Bugfix update for the recent major release

- Drivebase example added

-- Bugfixes --

EVNMotor: runTime bug where function completes instantly is fixed, runPosition bug where motor runs but jitters is fixed

EVNDrivebase: fixed bug where run to endpoint functions sometimes never complete

1.0.0 (21/09/24)

Major update to several libraries, outlined below.

-- Bugfixes --

EVNAlpha, EVNMotor, EVNDrivebase, EVNServo, EVNContinuousServo: All classes that use timer-based interrupts now use memory barriers and the RP2040's hardware spinlocks for thread-safe operation. This should improve stability and address seemingly random crashes with undefined behaviour that are difficult to predictably reproduce.

0.10.7 (11/09/24)

Small update to fix a rather glaring issue with the motor/drivebase classes.

-- Bugfixes --

EVNMotor & EVNDrivebase: For functions with a defined endpoint (e.g. straight, runPos), motors sometimes randomly run indefinitely past the endpoint. This bug has been fixed.

-- Changes --

Syntax Colouring: From now on, the only library syntax that will be highlighted are constants (e.g. EV3_LARGE) and class names (e.g. EV3 Colour Sensor)

0.10.6 (19/08/24)

A lot of bugfixes!

-- Features --

EVNMotor: setPosition() function added

-- Bugfixes --

EVNBluetooth: Was pretty much broken before, has been fully tested working with documentation and examples

PlatformIO Support: Was broken for a while after being added to Arduino-Pico core, has been fixed

Generic RP2040 Board Support: It's now possible to use this profile for programming! As long as begin() is called on an EVNAlpha object, the pins should be set correctly and work fine.

Dynamic Creation: EVNMotor/Drivebase/Servo/ContinuousServo and all other classes should support being created dynamically (using new) now

EVNMotor: resetPosition() fails after being called once, this has been fixed

0.10.5 (05/08/24)

Very small update, most of the changes are to the documentation

-- Features --

Library now raises readable errors when compiling without EVN Alpha selected, or with an Arduino-Pico core version that is too old

Docs now have images of the standard peripherals!

-- Bugfixes --

Not a bugfix, but EVNDrivebase seems to have some issues at low speeds using EV3 Medium motors

We will be looking into this issue and hopefully pushing changes to fix it if it is common.

0.10.4 (01/08/24)

This is a small update to update docs and make style changes to the library.

Many aliased (duplicate) functions have been removed from the following classes:
* EVNAlpha
* EVNMotor
* EVNDrivebase
* EVNIMUSensor
* EVNColourSensor
* EVNServo
* EVNContinuousServo

More alias functions may be removed in future updates, and some may remain but this will be an exception, not the norm moving forward.

-- Bugfixes --

EVNMotor: stop() was declared but undefined. It has now been defined, and replaces brake() as the braking function. So do not call brake() in your code.

0.10.3 (28/07/24)

-- Features --

- Madgwick IMU Sensor Fusion and Axis Configuration added to EVNIMUSensor and EVNCompassSensor
- Docs added for EVNADC
- Examples added for EVNBluetooth and EVNADC
- We've now been added to the official board list for the arduino-pico core!

-- Bugfixes --

- Improved stability for EVNDrivebase
- EVNDrivebase and EVNMotor must be run on 2nd core, docs now reflect this

0.10.2 (07/07/24)

-- Features --

- User Guides have been added to the docs site! With more coming soon
- This small update is mainly to fix bugs with EVNMotor and EVNDrivebase
- There will be at least one more before this repository is displayed on the main EVNdevs GitHub repo.

-- Bugfixes --

- runPosition and similar position-based run functions now work properly when called back-to-back
- Accel/decel has correct logic now
- Motor jitter on boot is now gone

0.10.2 (07/07/24)

-- Features --

- User Guides have been added to the docs site! With more coming soon
- This small update is mainly to fix bugs with EVNMotor and EVNDrivebase
- There will be at least one more before this repository is displayed on the main EVNdevs GitHub repo.

-- Bugfixes --

- runPosition and similar position-based run functions now work properly when called back-to-back
- Accel/decel has correct logic now
- Motor jitter on boot is now gone

0.10.1 (28/06/24)

-- Features --

- Added docs and more unified syntax for almost all classes introduced in 0.10.0 (except EVNAnalogMux)
- Added more hardware/product docs
- Added example programs for almost everything (at this point I should relook at the old ones)
- Low Battery Alert has officially been added!

-- Bugfixes --

- EVNRGBLED: Stability of update() improved (should be perfect now)
- EVNButton: Stability of button readings should be much improved

0.10.1 (28/06/24)

-- Features --

- Added docs and more unified syntax for almost all classes introduced in 0.10.0 (except EVNAnalogMux)
- Added more hardware/product docs
- Added example programs for almost everything (at this point I should relook at the old ones)
- Low Battery Alert has officially been added!

-- Bugfixes --

- EVNRGBLED: Stability of update() improved (should be perfect now)
- EVNButton: Stability of button readings should be much improved

0.10.0 (30/05/24)

"Why is every revision a major one?"

-- Features --

- Last few peripherals added: EVNSevenSegmentLED, EVNMatrixLED, EVNAnalogMux & EVNContinuousServo (most have no docs, to be added soon)
- More more bugfixes
- There will be more tutorials and better docs in the next 0.10.x revisions

-- Bugfixes --

- EVNRGBLED: Stability of update() improved
- EVNMotor & EVNDrivebase: Fixed long-running bug where timer interrupts were causing more complex programs to fail
- EVNDisplay rows are now zero-indexed (and this is permanent)
- EVNAlpha: fixed bug where cell voltage measurement would fail 40s after begin()

0.9.0 (13/05/24)

- Changelog now has new entries at top, not bottom
- Added the following libraries and docs: EVNRGBLED, EVNBluetooth, EVNServo, EVNEnvSensor, EVNTouchArray
- Added hardware documentation
- Made PID tuning for EVNDrivebase generally work on both Large and Medium motors
- Improved reliability and accuracy of EVNMotor DPS measurement
- More bugfixes and streamlining everywhere

-- Features --

- Docs have been reformatted for Read the Docs integration

- Complete rewrite of EVNMotor: position PD is used instead of speed PI control for greater stability
- Control units are all in DPS (degrees per second)
- Stall detection added

- First official addition of EVNDrivebase with motor sync & odometry

- All peripheral classes using I2C are now more strict about the use of begin()
- If begin() is not called or returns false, any other functions will automatically return 0

- Battery voltage monitoring functions added, with a battery alert whenever they are called

0.8.0 (25/03/24)

-- Features --

There are too many changes to keep track of for this revision...so just the highlights!

- Docs have been reformatted for Read the Docs integration

- Complete rewrite of EVNMotor: position PD is used instead of speed PI control for greater stability
- Control units are all in DPS (degrees per second)
- Stall detection added

- First official addition of EVNDrivebase with motor sync & odometry

- All peripheral classes using I2C are now more strict about the use of begin()
- If begin() is not called or returns false, any other functions will automatically return 0

- Battery voltage monitoring functions added, with a battery alert whenever they are called

0.7.1 (28/02/24)
This is meant to be a stable release for current pre-release users, until the EVNMotor rewrite and drivebase classes with motor sync are released

-- Features --

- Added a temporary version of EVNDrivebase and EVNOmniDrivebase (no motor sync yet!)
- Minor doc corrections

-- Bugfixes --

- Fixed many bugs in EVNMotor including a stray debug print
- Fixed a bug in EVNButton causing non-default settings to fail (stuck on defaults)
- Higher I2C frequencies now supported by EVN Alpha object! (Tested at 400kHz)

0.7.0 (04/02/24)

- Removed RPi_PICO_TimerInterrupt dependency and replaced with C++ SDK code
- To be added soon: more docs and examples

-- Features --

- Added libraries for EVNBluetooth and EVNBattery (using BQ25887 IC on V1.4 boards onwards)
- Added accel and decel settings to EVNMotor, along with functions to edit PPR, max RPM, and PID controls

-- Bugfixes --

- Fixed bug in EVNDisplay::begin() making it fail to start
- Fixed bug in EVNPortSelector (helper for EVNAlpha) to allow for I2C clock speeds over 100kHz

0.6.1 (17/1/24)

- Put changelog in correct folder

-- Features --

- Modified settings for VL53L0X for greater range (1.8m)

-- Bugfixes --

- Fixed bug to allow for EVNDistanceSensor to work on I2C ports 9-16

0.6.0 (16/1/24)

- First changelog entry!
- Added docs for EVNDistanceSensor and EVNCompassSensor

-- Features --

- EVNDistanceSensor added
- EVNMagSensor has been renamed to EVNCompassSensor
- Compatiibility with QMC5883L added to EVNCompassSensor
- EVNMotor now has functions to move to absolute position (not just relative position), and reset the encoder's absolute position to 0.

-- Bugfixes --

- Dependencies added (will be removed when published on Arduino's Library Manager)
- Fixed bug with EVNPortSelector, where port 1 should be selected at startup, but no "select port 1" I2C commands were actually sent.
- Rectified some math in EVNMotor such that any variables labelled PPR (pulse per revolution) actually reflect real-world motor encoder PPR
