yesterday i've built my first bbb including the led matrix.
it wasn't as easy as i thought but i coped it

the only problem was that the original pin-allocation
from the matrix wasn't possible to connect to my bbb.
So my current positions are:
Code: Select all
(BBB Pin = Matrix Pin = Script Variable)
4 = LE = latchPin
5 = OE = outputEnable
6 = CLK = clockPin
7 = DI = dataPin
8 = DO = (none placement in the script)
(i hoped that i can modificate the snippet so i can play a
little movie sequence):
Code: Select all
// found on moderndevice.com form. written by paul b.
#include <avr/pgmspace.h>
int latchPin = 4; //Pin connected to SPI latch
int clockPin = 6; //Pin connected to SPI clock -
int outputEnable = 5; //Pin connected to SPI output enable - high equals off
int dataPin = 7; //Pin connected to SPI clock
int totalFrames;
int frameDelay = 50; // 10 frames per second
// first frame, second frame, third frame
unsigned int show[] = {
28700,7280,3640,14350, 14392,3808,1904,7196, 7280,1984,992,3640, 3808,992,1984,1904,
1984,1904,3808,992, 992,3640,7280,1984, 1904,7196,14392,3808, 3640,14350,28700,7280,
7196,28679,57358,14392, 14350,57351,57351,28700, 28679,57358,28679,57358, 57351,28700,14350,57351,
}; // put some data in here with 8x8 calculator on the 8x8 page
void setup() {
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
digitalWrite(latchPin, HIGH);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(outputEnable, OUTPUT);
digitalWrite(outputEnable, LOW);
Serial.begin(9600);
Serial.println("start");
// finds total frames divide by 8 because 2 bytes per int, 4 ints per frame
// sizeof may report bytes instead of ints
totalFrames = sizeof(show); // find message size, counting total ints because
// I'm indexing frames by 4 below (frames+=4)
}
void loop(){
playAnimation();
}
void playAnimation(){
// send the data to the display
digitalWrite(latchPin, LOW); //take latchPin LOW for as long as you are sending data
for (int frames=0; frames<totalFrames; frames+=4){
for (int i=0; i<4; i++){
shiftOut(dataPin, clockPin, MSBFIRST, (show[frames + i] >> 8)); // send high byte
shiftOut(dataPin, clockPin, MSBFIRST, show[frames + i] ); // send low byte
}
digitalWrite(latchPin, HIGH); //return the latch pin HIGH to update LED's
delay(frameDelay);
}
}
void off(int pause){
digitalWrite(outputEnable, HIGH); // turn off enable line, you can also use analogWrite() to dim the display
// make sure you use a PWM pin though on Arduino, or it won't work
}
my wish is that i have'nt any pause or delay between the repetitions.
Can you give me a little help
PS: I have uploaded a little video of the whole sequenz with the curios pause at the end. Here is the link.
Thank you
Jones
EDIT:
I have noticed that the "crazy blink phase" segments of sequences from older scripts contains that i've uploaded one or two times before.
2nd EDIT:
I have to correct my last edit. its exactly the last script that i've uploaded before! Does the BBB includes something like a Cache?
If its true, how can i clear it? =)