Demonstrate how to expose multiple batteries - DO NOT MERGE #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR is NOT intended for merging, only to showcase how multiple batteries can be simulated after #36 and #37 are merged.
There seems to be an Arduino HW limit of 7 USB endpoints. This limits the maximum number of simulated batteries to 3 by default, but this can be increased to 6 by defining
CDC_DISABLED
inC:\Users\<username>\AppData\Local\Arduino15\packages\arduino\hardware\avr\<version>\cores\arduino\USBDesc.h
to disable the USB serial console endpoints. If doing so, then one needs to use the Arduino's reset button to be able to flash it.Windows 10 screenshots
Screenshots where


CDC_DISABLED
is defined to enable 6 batteries.UPS.ino
has also been modified to expose slightly different charge levels for each battery to make the example more interesting:Windows 2000 screenshot
HID battery support actually goes back to Windows 2000, which was released 25 years ago.

The screenshot was obtained by creating a Windows 2000 SP4 VM in VirtualBox and forwarding the Arduino USB device to the VirtualBox VM. A default Windows 2000 installation will then automatically detect the HID battery devices, even without Windows Update connectivity.