pyupm_cjq4435 module

class pyupm_cjq4435.CJQ4435(pin)[source]

Bases: object

API for the CJQ4435 MOSFET.

ID: cjq4435

Name: MOSFET

Other Names: CJQ4435

Category: electric

Manufacturer: seeed

Connection: gpio pwm

Kit: robok UPM module for the CJQ4435 MOSFET. It was developed using the Grove MOSFET module, but could be used with any MOSFET. A MOSFET is like a switch, but it can switch much faster than a mechanical relay. Here, we implement support via MRAA pulse width modulation (PWM) functions. Note: available periods vary depending on the capabilities of your platform.

C++ includes: cjq4435.hpp

enable(enable)[source]

void enable(bool enable)

Enables output

enable: Enables PWM output if true, disables otherwise

off()[source]

void off()

Shortcut to turn the output to continuous off (low)

on()[source]

void on()

Shortcut to turn the output to continuous on (high)

setDutyCycle(dutyCycle)[source]

void setDutyCycle(float dutyCycle)

Sets a duty cycle. Duty cycle is a floating-point number between 0.0 (always off) and 1.0 (always on). It represents a proportion of time, per period, during which the output is driven high.

dutyCycle: Duty cycle to use

setPeriodMS(ms)[source]

void setPeriodMS(int ms)

Sets a period in milliseconds

ms: Period in milliseconds

setPeriodSeconds(seconds)[source]

void setPeriodSeconds(float seconds)

Sets a period in seconds

seconds: Period in seconds

setPeriodUS(us)[source]

void setPeriodUS(int us)

Sets a period in microseconds

us: Period in microseconds