I can use the dotstar strips fine using my own programming.
When I try to use hardware SPI. I get the following error message at compile time.
Code: Select all
SPI_test.cpp.o: In function `WRITE_LED(unsigned char)':
/usr/share/arduino/SPI_test.ino:44: undefined reference to `SPIClass::begin()'
collect2: error: ld returned 1 exit status
Here is my code.
Code: Select all
/* Test SPI CODE */
#include "SPI.h"
const int dataReadyPin = 6;
const int chipSelectPin = 7;
byte b0 = B00000000;
byte b255 = B11111111;
byte GLOBOL = B1;
byte RED = B0;
byte GREEN = B0;
byte BLUE = B0;
void setup() {
Serial.begin(57600);
SPI.begin();
}
void loop() {
GLOBOL = b0;
BLUE = b0;
GREEN = b0;
RED = b0;
WRITE_LED(GLOBOL); // send 32 bits of 0 to
WRITE_LED(GLOBOL); // start the led string
WRITE_LED(GLOBOL);
WRITE_LED(GLOBOL);
delay (100);
GLOBOL = b255;
BLUE = b255; // turn on bright blue
GREEN = b0;
RED = b0;
WRITE_LED(b255); // send globol byte
WRITE_LED(BLUE); // send blue byte
WRITE_LED(GREEN); // send green byte
WRITE_LED(RED); // send red byte
delay (5000);
}
void WRITE_LED(byte globol){
SPI.transfer(globol);
}