Hi!
As time passed and I got to this problem. Written test, but not everything works. Please advise what's wrong?
/*
attn!!!
TPIC6C595 CPOL=0, CPHA=0 ----> MODE0
*/
#include <SPI.h>
#define LE 10
unsigned long long xArray[37] = {
0B0000000000000000000000000000000000000000000000000000000000001000,
0B0000000000000000000000000000000000000000000000000000000000000100,
0B0000000000000000000000000000000000000000000000000000000000000010,
0B0000000000000000000000000000000000000000000000000000000000000001,
0B0000000000000000000000000000000000000000000000000000000000010000,
0B0000000000000000000000000000000000000000000000000000000000100000,
0B0000000000000000000000000000000000000000000000000000000001000000,
0B0000000000000000000000000000000000000000000000000000000010000000,
0B0000000000000000000000000000000000000000000000000000100000000000,
0B0000000000000000000000000000000000000000000000000000010000000000,
0B0000000000000000000000000000000000000000000000000000001000000000,
0B0000000000000000000000000000000000000000000000000000000100000000,
0B0000000000000000000000000000000000000000000000000001000000000000,
0B0000000000000000000000000000000000000000000000000010000000000000,
0B0000000000000000000000000000000000000000000000000100000000000000,
0B0000000000000000000000000000000000000000000000001000000000000000,
0B0000000000000000000000000000000000000000000010000000000000000000,
0B0000000000000000000000000000000000000000000001000000000000000000,
0B0000000000000000000000000000000000000000000000100000000000000000,
0B0000000000000000000000000000000000000000000000010000000000000000,
0B0000000000000000000000000000000000000000000100000000000000000000,
0B0000000000000000000000000000000000000000001000000000000000000000,
0B0000000000000000000000000000000000000000010000000000000000000000,
0B0000000000000000000000000000000000000000100000000000000000000000,
0B0000000000000000000000000000000000001000000000000000000000000000,
0B0000000000000000000000000000000000000100000000000000000000000000,//work
0B0000000000000000000000000000000000000010000000000000000000000000,//work
0B0000000000000000000000000000000000000001000000000000000000000000,//work
0B0000000000000000000000000000000000010000000000000000000000000000,//work
0B0000000000000000000000000000000000100000000000000000000000000000,
0B0000000000000000000000000000000001000000000000000000000000000000,
0B0000000000000000000000000000000010000000000000000000000000000000,
0B0000000000000000000000000000100000000000000000000000000000000000,//work
0B0000000000000000000000000000010000000000000000000000000000000000,//work
0B0000000000000000000000000000001000000000000000000000000000000000,//work
0B0000000000000000000000000000000100000000000000000000000000000000 //work
};
//rest leds is not work !!!!!!!!!!!!!!!!
unsigned long long z ;
byte b[8];
union MatrixData
{
unsigned long long z;
byte b[8];
};
MatrixData l;
void setup()
{
pinMode(LE, OUTPUT);
digitalWrite (LE, HIGH);
SPI.begin(); // Initializes the SPI bus by setting SCK, MOSI, and SS
to outputs, pulling SCK and MOSI low, and SS high.
// default:
//SPI.setDataMode(SPI_MODE0);
//SPI.setBitOrder(MSBFIRST);
//SPI.setClockDivider(SPI_CLOCK_DIV4);
}
void loop()
{
for (int ringAnt = 1; ringAnt <= 36; ringAnt = ringAnt + 1)
{
digitalWrite (LE, LOW);
l.z = xArray[ringAnt] ;
for (int i = 0; i < 8; i = i + 1)
{
SPI.transfer (l.b[i]);
}
digitalWrite (LE, HIGH);
delay (300);
}
}