|
upm
0.2.0
Sensor/Actuator repository for libmraa (v0.6.1)
|
C++ API for the CJQ4435 MOSFET. More...
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's PWM (Pulse Width Modulation) functions. Please note, that the available periods will vary depending on the capabilities of your device.
Public Member Functions | |
| CJQ4435 (int pin) | |
| ~CJQ4435 () | |
| void | setPeriodUS (int us) |
| void | setPeriodMS (int ms) |
| void | setPeriodSeconds (float seconds) |
| void | enable (bool enable) |
| void | setDutyCycle (float dutyCycle) |
| void | on () |
| void | off () |
| CJQ4435 | ( | int | pin | ) |
CJQ4435 constructor
| pin | digital pin to use - this pin must be PWM capable |
| void setPeriodUS | ( | int | us | ) |
set the period in microseconds
| us | period in microseconds |
| void setPeriodMS | ( | int | ms | ) |
set the period in milliseconds
| ms | period in milliseconds |
| void setPeriodSeconds | ( | float | seconds | ) |
set the period in seconds
| seconds | period in seconds |
| void enable | ( | bool | enable | ) |
enable output
| enable | enable PWM output if true, disable if false |
| void setDutyCycle | ( | float | dutyCycle | ) |
set the duty cycle. The duty cycle is a floating point number between 0.0 (always off) to 1.0 (always on). It represents how much time as a percentage, per period, that the output will be driven high.
| dutyCycle | the duty cycle to use |
| void on | ( | ) |
a shortcut for turning the output to continuous on (high)
| void off | ( | ) |
a shortcut for turning the output to continuous off (low)
1.8.9.1