hello, i've written adapted an arduino library to a circuitpython library. to finish the…
Rate quality
Private research annotation
Sign in to add a private research label or note.
Jump to turn (16)
- 1hello, i've written adapted an arduino library to a circuitpython library. to fi
- 2let's start with the class definition and init function: class AdafruitHUSB238:
- 3can we add the default i2c address to init
- 4great. here is the next circuitpython function: def reset(self): self.gocommand
- 5great. here is the circuitpython function: def requestPD(self): self.gocommand =
- 6circuitpython function: def getSourceCapabilities(self): self.gocommand = 0x02 )
- 7the next function is a property with a setter: @property def value(self) -> int:
- 8great. next is this function: def availablevoltages(self): availablevoltages = [
- 9excellent. next function: def readcurrent(self): if self.pdsrccurrent in self.PD
- 10great. next function: def readvoltage(self): ) if self.pdsrcvoltage in self.PDOT
- 11circuitpython function: def getPDresponse(self): pdomsg = self.PDORESPONSECODES[
- 12great. circuitpython function: def get5Vcontractvolts(self): volts = return volt
- 13wonderful! circuitpython function:
- 14wonderful! circuitpython function: def get5Vcontractamps(self): amps = self.cont
- 15awesome. next function: def getCCdirection(self): cc = self.ccdirection if cc: p
- 16great! last function: def isattached(self): status = self.attachmentstatus retur
- User
hello, i've written adapted an arduino library to a circuitpython library. to finish the circuitpython library, i want to add typing and comments. i'll include the comments from the arduino library when applicable. we'll go function by function
- Assistant
Sounds like a plan, . Let's get started. Please share the first function you'd like to work on.
- User