Giter Site home page Giter Site logo

skyrcusb's Introduction

skyrcUSB

This is a library which you can use to interface with your skyRC charger. Examples of what it can do is return the voltages of all the cells (even when not charging) and can also return charge data in real time - to one more decimal point than the display on the charger! It has only been tested with the D100V2 and will throw an error if it detects a different model - it should however work in theorey.

This library has been made by reverse engineering the protocol, and I therefore cannot guarantee that it is completely perfect. Note - this library is released under the MIT license, and therefore includes absolutely no warranty.**

This library is also not able to write changes to the charger or start charges

Example usage is below:

import skyrcUSB

# Get charger info

charger = skyrcUSB.Charger()  # Instantiate object and connect
print(f"Model {charger.model_name} SW:{charger.software_version} \n")


# Get voltages for each cell

for sideID in range(2):
    vcells = charger.getCellInfo(side=sideID)  
    if vcells:
        print(f"{len(vcells)} Cells in the battery")
        [print(f"Cell {i+1}:  {v}mV") for i, v in enumerate(vcells)]
    else:
        print(f"No Cells on side {chr(65+sideID)}")

# Get charger settings

charger.getSettings()

print(f"\nThe charger is configured to not exceed {charger.maxTemp} C or {charger.maxCapacity} mah\n")


# Get charge data on side B

cstate = charger.getChargeData(1)

if cstate.isError():
    print(f"Error: {cstate.getErrorString()}!!!\n")

if not cstate.isIdle(): # if charger is charging or finished
    print(f"Status: {cstate.getStatusString()}")
    print(f"Voltage: {cstate.voltage} mV")
    print(f"Current: {cstate.current} mA")
    print(f"Capacity: {cstate.capacity} mah")
    print(f"Duration: {cstate.chargeDuration} seconds")
else:
    print("Charger has not started charging.")

Have a look at the ./examples/ directory for examples, although you will likely need to take a look at the source code for more advanced usage (who needs documentation?)

The license can be found in LICENSE.txt

skyrcusb's People

Contributors

qduff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.