API for the CJQ4435 MOSFET.
More...
- ID: cjq4435
- Name: Grove 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. 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.
while (shouldRun)
{
for (float i=0.0; i <= 1.0; i+=0.1)
{
usleep(100000);
}
sleep(1);
for (float i=1.0; i >= 0.0; i-=0.1)
{
usleep(100000);
}
sleep(1);
}
CJQ4435 constructor
- Parameters
-
pin | Digital pin to use; this pin must be PWM-capable |
void setPeriodUS |
( |
int |
us | ) |
|
Sets a period in microseconds
- Parameters
-
void setPeriodMS |
( |
int |
ms | ) |
|
Sets a period in milliseconds
- Parameters
-
void setPeriodSeconds |
( |
float |
seconds | ) |
|
Sets a period in seconds
- Parameters
-
void enable |
( |
bool |
enable | ) |
|
Enables output
- Parameters
-
enable | Enables PWM output if true, disables otherwise |
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
-
dutyCycle | Duty cycle to use |
Shortcut to turn the output to continuous on (high)
Shortcut to turn the output to continuous off (low)
The documentation for this class was generated from the following files:
- /iotdk/jenkins/workspace/upm-doc-stable/src/cjq4435/cjq4435.h
- /iotdk/jenkins/workspace/upm-doc-stable/src/cjq4435/cjq4435.cxx