An input/output controller for virtual pinball machines, with plunger position tracking, accelerometer-based nudge sensing, button input encoding, and feedback device control.
Dependencies: USBDevice mbed FastAnalogIn FastIO FastPWM SimpleDMA
TLC5940 Class Reference
This class controls a TLC5940 PWM driver IC. More...
#include <TLC5940.h>
Public Member Functions | |
TLC5940 (PinName SCLK, PinName MOSI, PinName GSCLK, PinName BLANK, PinName XLAT, int nchips) | |
Set up the TLC5940. | |
void | set (int idx, unsigned short data) |
Set the next chunk of grayscale data to be sent. |
Detailed Description
This class controls a TLC5940 PWM driver IC.
Using the TLC5940 class to control an LED:
#include "mbed.h" #include "TLC5940.h" // Create the TLC5940 instance TLC5940 tlc(p7, p5, p21, p9, p10, p11, p12, 1); int main() { // Enable the first LED tlc.set(0, 0xfff); while(1) { } }
Definition at line 152 of file TLC5940.h.
Constructor & Destructor Documentation
TLC5940 | ( | PinName | SCLK, |
PinName | MOSI, | ||
PinName | GSCLK, | ||
PinName | BLANK, | ||
PinName | XLAT, | ||
int | nchips | ||
) |
Set up the TLC5940.
- Parameters:
-
SCLK - The SCK pin of the SPI bus MOSI - The MOSI pin of the SPI bus GSCLK - The GSCLK pin of the TLC5940(s) BLANK - The BLANK pin of the TLC5940(s) XLAT - The XLAT pin of the TLC5940(s) nchips - The number of TLC5940s (if you are daisy chaining)
Member Function Documentation
void set | ( | int | idx, |
unsigned short | data | ||
) |
Generated on Fri Jul 15 2022 08:43:32 by 1.7.2