UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

CJQ4435 Class

Module: cjq4435
  • 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.
cjq4435.jpg

Methods

CJQ4435

(
  • pin
)
Number

CJQ4435 constructor

Parameters:

  • pin Number

    Digital pin to use; this pin must be PWM-capable

Returns:

Number:

setPeriodUS

(
  • us
)

Sets a period in microseconds

Parameters:

  • us Number

    Period in microseconds

setPeriodMS

(
  • ms
)

Sets a period in milliseconds

Parameters:

  • ms Number

    Period in milliseconds

setPeriodSeconds

(
  • seconds
)

Sets a period in seconds

Parameters:

  • seconds Number

    Period in seconds

enable

(
  • enable
)

Enables output

Parameters:

  • enable Boolean

    Enables PWM output if true, disables otherwise

setDutyCycle

(
  • 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.

Parameters:

  • dutyCycle Number

    Duty cycle to use

on

()

Shortcut to turn the output to continuous on (high)

off

()

Shortcut to turn the output to continuous off (low)