Right, I decided to make bugger display now and mistakenly thought that wouldn't make code much harder; obviously I was wrong.
I managed to make scrolling text, varying speed with potentiometer, look specified portion of text (variable scroll you could say) and make 9999 seconds counter (I like my eggs bit harder....)
But, to make even 8x16 screen that scrolls smoothly, that seems hard, or then I'm just looking in wrong direction. Most schemes I looked either had separate drivers for columns/rows, or then that MAX's ic (Don't have single one of those.....).
But, my circuit has daisy-chained shift registers, I know they're not cause of trouble as I have same setup, only bigger in 8' cube, and it works well. Rows are controlled with one shift register, and columns with darlingtons paired with shift registers
Now, I'm asking again help here, what would be best approach with issue?
This code scrolls numbers from 0-9, but on all matrises same time (well, that's what is intented too in code) Please don't give code right away, I learned so much recently and 'I'd like to keep that way,
surely you'll understand. Interrupt or 2d-array needed? And ask if you need more info.
//scrolls text with variable speed, or with set speed
int dataPin = 2; //IC 14 //Define which pins will be used for the Shift Register control
int latchPin = 3; //IC 12
int clockPin = 4; //IC 11
//OE-GND
//MR-VCC
int delaytime = 1, timer, timerPrev = 0;
int shift = 0;
int len = 80;
int m;
static uint8_t x [80] = //numbers stored here
{
0x00, 0x7c, 0xa2, 0x92, 0x8a, 0x7c, 0x00, 0x00, // 0
0x00, 0x42, 0xfe, 0x02, 0x00, 0x00, 0x00, 0x00, // 1
0x00, 0x42, 0x86, 0x8a, 0x92, 0x62, 0x00, 0x00, // 2
0x00, 0x84, 0x82, 0xa2, 0xd2, 0x8c, 0x00, 0x00, // 3
0x00, 0x18, 0x28, 0x48, 0xfe, 0x08, 0x00, 0x00, // 4
0x00, 0xe4, 0xa2, 0xa2, 0xa2, 0x9c, 0x00, 0x00, // 5
0x00, 0x3c, 0x52, 0x92, 0x92, 0x0c, 0x00, 0x00, // 6
0x00, 0x80, 0x8e, 0x90, 0xa0, 0xc0, 0x00, 0x00, // 7
0x00, 0x6c, 0x92, 0x92, 0x92, 0x6c, 0x00, 0x00, // 8
0x00, 0x60, 0x92, 0x92, 0x94, 0x78, 0x00, 0x00, // 9
};
void setup() //runs once
{
DDRD = DDRD | B00011100; //set pins as output
}
void loop()
{
//int val = analogRead(A0); //if set speed, comment this out perhaps some better way for this too, but i'll let this be commented for now, was just test
timer = millis (); //set timer from current millis value
if (timer - timerPrev > 200) //change val to set value for set speed
{
shift++;
if (shift == len)shift = 0;
timerPrev = timer;
}
for (int i = 0; i < 8; i++)
{
PORTD = B00000000; //turn latch low
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
//if bigger > smaller true false, smaller way for if/else
shiftOut(dataPin, clockPin, LSBFIRST, x[i + shift > len - 1 ? i + shift - len : i + shift]); //Send the data #1 ( what data to draw)
/*
if (i+ shift > len -1)
{
m=i+shift-len; //equilavent way for ?
}
else
{
m=i+shift;
}
*/
PORTD = B00001000; //turn latch on->show screen
}
}