upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

API for the CJQ4435 MOSFET. More...

Detailed Description

UPM module for the CJQ4435 MOSFET. It was developed using the Grove MOSFET module. 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 device.

cjq4435.jpg

Public Member Functions

synchronized void delete ()
 
 CJQ4435 (int pin)
 
void setPeriodUS (int us)
 
void setPeriodMS (int ms)
 
void setPeriodSeconds (float seconds)
 
void enable (boolean enable)
 
void setDutyCycle (float dutyCycle)
 
void on ()
 
void off ()
 

Constructor & Destructor Documentation

CJQ4435 ( int  pin)

CJQ4435 constructor

Parameters
pinDigital pin to use; this pin must be PWM-capable

Member Function Documentation

void enable ( boolean  enable)

Enables output

Parameters
enableEnables PWM output if true, disables otherwise
void off ( )

Shortcut to turn the output to continuous off (low)

void on ( )

Shortcut to turn the output to continuous on (high)

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.

Parameters
dutyCycleDuty cycle to use
void setPeriodMS ( int  ms)

Sets a period in milliseconds

Parameters
msPeriod in milliseconds
void setPeriodSeconds ( float  seconds)

Sets a period in seconds

Parameters
secondsPeriod in seconds
void setPeriodUS ( int  us)

Sets a period in microseconds

Parameters
usPeriod in microseconds

The documentation for this class was generated from the following file: