Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/LedControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ LedControl::LedControl(int dataPin, int clkPin, int csPin, int numDevices) {
if(numDevices<=0 || numDevices>8 )
numDevices=8;
maxDevices=numDevices;
}

void LedControl::init() {
pinMode(SPI_MOSI,OUTPUT);
pinMode(SPI_CLK,OUTPUT);
pinMode(SPI_CS,OUTPUT);
digitalWrite(SPI_CS,HIGH);
SPI_MOSI=dataPin;
for(int i=0;i<64;i++)
status[i]=0x00;
for(int i=0;i<maxDevices;i++) {
Expand Down
7 changes: 7 additions & 0 deletions src/LedControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ class LedControl {
*/
LedControl(int dataPin, int clkPin, int csPin, int numDevices=1);

/*
* Initialize chip and display. Allows for initialization within
* setup(), which is the only way to do it on some platforms
* as Energia.
*/
void init();

/*
* Gets the number of devices attached to this LedControl.
* Returns :
Expand Down