Skip to content

Nice work! #4

@septillion-git

Description

@septillion-git

Heyy,

Cool you forked QC2Controll for QC3! Lucky I saw it at Hackaday (since I can't read all articles anymore). I would have liked a message from you and I bed Hugatry as well 😉

But I do have some notes 😁

The abbreviation "PD" is a bit confusing. In combination with USB it's commenly used as USB Power Delivery.

I made the library on the notes of Hugatry. This included the resistors I picked. It's nice to see you found an error in it for QC3 chargers. But I do have to note, the resistors I picked where compatible with both 5V and 3,3V Arduino's. So that might be a good note to mention in the differences between QC2 and QC3. And try to make QC3Controll work with 3,3V Arduino's as well (new values or a 3,3V Arduino schematic).

Inline functions should be in .h

Macros (#define) are a relic from C. C++ has nicer and saver ways of doing it. In this case, static const.

Doubles are overkill, a float will do ;) Makes no difference on ATmega's but on 32-bit is does. Even a float is a bit of a hack because floats != decimal point. But I get why you would like it to make it simple and intuitive.

There was no need to break compatibility for setVoltage() ;) There is something called function overloading 😄

I personally think the voltage ramping is more annoying then useful. If I set a voltage I want to get there as quick as possible. Do the discrete voltages really need the 60ms of waiting?

And although not every charger goes to 20V, isn't it a bit much to make this a setting? 😕

0 is a valid pin on an Arduino. Although on a lot it's a UART pin, it's not very nice to exclude it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions