need help with p.o.v section of slapped together tix clock

so ive put together a shabby tix clock and have the clock and digit functions set up ...
but have no idea how to go about displaying the correct leds for each time pattern
im probably asking alot (more than im currently capable of)
if it helps ive attached an image of my board layout

#include <TimeLib.h>
#include <Wire.h>
#include <DS1307RTC.h>  // a basic DS1307 library that returns time as a time_t
int digit1;
int digit2;
int digit3;
int digit4;
int rpins[] = {     //anode pins "rows"
  26,27,28,32,36,40,43,44,49
}; 
int cpins[] = {     // cathode pins "columns"
  52,50,48
}; 
// array totals
int rpinc = 9;           // number of rows
int cpinc = 3;           // number of columns
void setup() {
    Serial.begin(9600);
  for (int thisPin = 0; thisPin < rpinc; thisPin++) {       //initialise rowpins as outputs
    pinMode(rpins[thisPin], OUTPUT);
  }
  for (int thisPin = 0; thisPin < cpinc; thisPin++) {       //initialise columnpins as outputs
    pinMode(cpins[thisPin], OUTPUT);
  }
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if(timeStatus()!= timeSet) {
     Serial.println("Unable to sync with the RTC");
     test();
          flash();
     delay(200);
          flash();
     delay(200);
          flash();
     delay(200);
     }
  else{
     Serial.println("Time retrieved from rtc"); 
     test();
     flash();
     delay(200);
          flash();
     delay(200);
  }
}
void loop() {
displayTime();
delay(1000);
}
void test() {

  for (int thisPin = 0; thisPin < 3; thisPin++) {
    digitalWrite(cpins[thisPin], HIGH);       //set column cathodes to high "off"
  }
  for (int thisPin = 0; thisPin < 9; thisPin++) {
    digitalWrite(rpins[thisPin], LOW);        //set row pins to low "off"
  }
  for (int thisPin = 0; thisPin < 3; thisPin++) {         //for each column set column cathodes to low for a test
    digitalWrite(cpins[thisPin], LOW);       //set current column cathodes to low "on"
    for (int thisPin = 0; thisPin < 9; thisPin++) {         //loop through row anode pins setting to high for a 100 msecond test
    digitalWrite(rpins[thisPin], HIGH);
    delay(75);
    digitalWrite(rpins[thisPin], LOW);
  }
    digitalWrite(cpins[thisPin], HIGH);       //set column cathodes to HIGH "on"
}
}
void flash() {
  for (int thisPin = 0; thisPin < 3; thisPin++) {
    digitalWrite(cpins[thisPin], HIGH);       //set column cathodes to high "off"
  }
  for (int thisPin = 0; thisPin < 9; thisPin++) {
    digitalWrite(rpins[thisPin], LOW);        //set row pins to low "off"
  }
  for (int thisPin = 0; thisPin < 3; thisPin++) {         //for each column set column cathodes to low for a test
    digitalWrite(cpins[thisPin], LOW);       //set current column cathodes to low "on"
    for (int thisPin = 0; thisPin < 9; thisPin++) {         //loop through row anode pins setting to high for a 100 msecond test
    digitalWrite(rpins[thisPin], HIGH);
    delay(1);
    digitalWrite(rpins[thisPin], LOW);
  }
    digitalWrite(cpins[thisPin], HIGH);       //set column cathodes to HIGH "on"
}
}
void displayTime()
{
digit1 = (hour() /10) %10;
digit2 = (hour() %10);
  if (minute() == 0)

digit3 = (minute() /10) %10;
digit4 = (minute() %10);

    Serial.print(hour());
        Serial.print(":"); 
Serial.print(minute());
    Serial.println(); 
        Serial.println(); 
    Serial.print("Digit 1=");  
    Serial.print(digit1);
    Serial.println(); 
        Serial.print("Digit 2=");  
    Serial.print(digit2);
    Serial.println(); 
        Serial.print("Digit 3=");  
    Serial.print(digit3);
    Serial.println(); 
        Serial.print("Digit 4=");  
    Serial.print(digit4);
    Serial.println(); 
    Serial.println(); 
    Serial.println(); 
}

20171029_125954.jpg

Spl1nt3rm4n:
if it helps ive attached an image of my board layout
75b0612eae98439fef6564e17ace8e1cb5addecd.jpg

From your description I can't figure out what this is supposed to do, let alone what you want it to do. Looking at this board, I think a circuit diagram would be a great help as well.

sorry, its a tix clock
so the top 2 blocks of leds display the hours
and the bottom 2 the minutes
i have it outputting to serial port at the moment ...
for example if it was 5:41 pm(17:41) it would display

or 6:45pm (18:45) it would show


attached is a better pic of my board...
20171029_1259154 (1).jpg
red lines are anodes attached to pins show on the right (rows)
black lines are cathodes attached to pins shown on top (columns)

i can light them up independantly for a self test.... but i do not know how to go about making them light up in sequence quickly to allow the different blocks to turn on simultaneously ... or rather alternatley but fast so persistance of vision makes it look like many are on at the same time.

20171029_1259154 (1).jpg

Thanking for explaining more completely. This is what you should have done in your first post. We did not know what a "tix" was. Your post subject said "pov" which means persistence of vision and made me think of "propeller" clocks like this one.

images.jpg

images.jpg

sorry for the confusion, but i believe all the information was in the first post.... just not laid right out in basic terms i did not call it a tix ... i called it a tix clock and i said pov because if i am correct that is the effect i will need to illuminate all the required squares as it cant be done simultaneously, thank you for the education on forum etiquette , but if anyone can at least steer me to a project using a led grid using persistance of vision to update multiple "cells" that i can adapt to my project this would be much apreciated.

i believe all the information was in the first post....

Not even close, but never mind, we are getting there!

You are correct to point out that multiplexing an led matrix is indeed a form of persistence of vision display.

I can see that you added only 3 resistors. This will mean using a 1 in 9 multiplex ratio. This will probably be ok, but the brightness may not be very consistent between the different colours, and the overall brightness may not be enough to see well in very bright light. If you are not happy with the brightness, you may have to remove those resistors and replace them with 9, on the anodes rather than the cathodes. This will allow a 1 in 3 ratio, which will be considerably brighter, and allow you to use different resistor values for each colour to achieve a more even brightness.

Next question: what kind of transistors are you using? I don't see them on the board. Without them, you will overload and damage the Arduino pins when you try to light more than one led at once.

Also, why is there a 30 pin header on the board? It should need only 12 pins. As wvmarle said, a schematic would be helpful.

i had an idea i would need to do that with the resistors and adjust for each led type, but i was going to look at that after... when i did a pwm tutorial i thought adjusting those resistors would be better left for the final versions when i had the code sorted... and i only used 3 as a quick way to get a prototype going.
as for the transistors, you may have saved my butt here, ive sort of been pulling ideas and code from other projects(my only way of creating seems to be copying parts from other ideas).
ie

i sort of knew i couldnt use too much current through the output pins, but thought from these examples maybe it was not an issue due to the on and off cycling.

not too sure how to go about setting that up but any help would be apreciated.
from my limited understanding of transistors i would need one for each row and column hey(everything attached to a digital output pin)?
what sort of transistor would be good for this... i couldnt use a bunch of 2n2222a i have left over from making silly little led flashers could i?

Hi,
Welcome to the forum.

This may be of help.
Using MAX7219 LED array driver, it has current limit/brightness control and a library for the Arduino to control it.

https://playground.arduino.cc/Main/MAX72XXHardware

if you google ardunio MAX7219

there are many tutorials and examples of using it to control an LED array like yours.

Tom... :slight_smile:

2n2222a could be ok.

The first thing to decide is what multiplexing scheme to use.

You can go for row-by-row which would give a 1 in 3 ratio, meaning all 9 LEDs in a row could be on at the same time and each row would be on for 1/3 of the time. This would require 9 series resistors and 3 transistors for the cathodes. (3 more resistors would be needed for the transistor bases.) This would give the best brightness.

You can go for column-by-column which would give a 1 to 9 multiplex ratio. 3 LEDs in the same column would be on at the same time and each column would be on for 1/9 of the time. Only 3 series resistors would be needed, and 9 transistors for the anodes. This would be one third of the brightness of the first suggestion, but would look brighter than that to the human eye because it is not linear. You could use the 2n2222 in emitter-follower configuration, so no base resistors needed. To get consistent brightness for the different led colours, you would need to use 9 series resistors instead of 3.

Currently, when your code performs its flash() function, it is not overloading the pins because only 1 led is ever lit at once, so the multiplexing is led-by-led. This results in a 1 in 27 ratio, which I would expect to be quite poor brightness. How do you find it? Try modifying your sketch to perform flash() over and over and view the display in different levels of ambient light.

i think i got a solution,

the below is displaying 22:42
any foreseeable problems doing it this way and just changing resistors to adjust led brightness?

20171029_224156.jpg

20171029_224156.jpg

tix_clock.ino (8.7 KB)

any foreseeable problems doing it this way

Yeah, the problems I mentioned before in my posts that you did not read. I guess they were too long and you got bored reading them.

such a smartass
"any foreseeable problems doing it this way and just changing resistors to adjust led brightness?"
the brightness thing is ok, just gotta work on resistor values ... and if you look at the code i last uploaded.
each led is being turned off and on individually. therefore taking the current issue out of the equation ....i thought....
"Currently, when your code performs its flash() function, it is not overloading the pins because only 1 led is ever lit at once"
which part am i ignoring... if youre just going to be rude... why stop by a help request topic....

Well, you complained about uneven LED brightness, were given an astute answer, and then your reply contradicts or at least glosses over the recommendations. What is a reader to think?

i didnt complain about led brightness ... someone else brought that up and i can adjust that later
i didnt gloss over or contradict any "astute answer" i have gotten here.... i can adjust brightness later with resistor changes, and the whole transister thing is a moot point because i am now turning the leds on then off without a delay one by one. my last question was more of a "is there anything wrong with turning the leds on and off so quickly for an indefinite period of time.... ill ask future questions elsewhere