Pages: 1 2 [3] 4   Go Down
Author Topic: Re: Programming Help  (Read 745 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dont think so lookin it up now
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok installed it but dont know what pins to plug in VCC,GND,CS,CLK and DIN
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

anyone?
Logged

UK
Offline Offline
Shannon Member
****
Karma: 183
Posts: 11148
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does your sketch compile? Does it upload successfully?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

anyone?

Would you stop bumping the thread and try to convey some useful information?

You had compile errors last time I looked. Have you fixed them? How about keeping us informed rather than bumping with "anyone?" every few hours?

Quote
dont know what pins to plug in VCC,GND,CS,CLK and DIN

I don't know either, so that makes two of us.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes it uploads sucsessfully
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i dont know how to declar varibles :S

Well, moving onto the next step then.

Have you worked out how to declare variables?

If not, Google "C++ tutorial".
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I declared varibles
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46011
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yes I declared varibles
This is worse than pulling teeth. Feel free to provide more that yes or no answers. Like, maybe posting your damned code.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I'm going to have to lock this thread. You show no inclination whatsoever to solve things for yourself. You bump the thread every day in the hope someone else will do it for you. You haven't posted code recently, nor given any other indication about what is going on.

Code:
   for (int l = 0; l < 8; l++) {

The lower-case letter "l" is an appallingly bad name for a variable. It looks just like the number "1" doesn't it?



Would you like me to move this to Gigs and Collaborations, where you can offer to pay someone to solve it all for you?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well i declared varibles and stuff heres the code:
Code:
#include <FrequencyTimer2.h>
#include "font.h"
#include "figuras.h"

byte col = 0;
byte leds[8][8];

// Pines conectados al Arduino (-1 es un fantasma para que empience en la posicion 1)
int pins[17]= {-1, 5, 4, 3, 2, 14, 15, 16, 17, 13, 12, 11, 10, 18, 8, 7, 6};

// Columnas de leds = Pines de la matriz
int cols[8] = {pins[13], pins[3], pins[4], pins[10], pins[06], pins[11], pins[15], pins[16]};

// Filas de leds = Pines de la matriz
int rows[8] = {pins[9], pins[14], pins[8], pins[12], pins[1], pins[7], pins[2], pins[5]};

const int numPatterns = 22;
byte patterns[numPatterns][8][8] = {
  D,A,V,G,E,E,K,PUNTO,C,O,M,SPACE,CARITA,SPACE,Bike,SPACE,Alto,SPACE,FlechaIzq,SPACE
};

int pattern = 0;

void setup() {
   // Todos los pines como salidas
   for (int i = 1; i <= 19; i++) {
     pinMode(pins[i], OUTPUT);
   }

   // Pines en bajo
   for (int i = 1; i <= 8; i++) {
     digitalWrite(cols[i + 1], LOW);
   }

   for (int i = 1; i <= 8; i++) {
     digitalWrite(rows[i + 1], LOW);
   }

   clearLeds();

   // Turn off toggling of pin 11
   FrequencyTimer2::disable();
   // Set refresh rate (interrupt timeout period)
   FrequencyTimer2::setPeriod(2000);
   // Set interrupt routine to be called
   FrequencyTimer2::setOnOverflow(display);

   setPattern(pattern);
}

void loop() {
     pattern = ++pattern % numPatterns;
     slidePattern(pattern, 100);
}

void clearLeds() {
   // Limpiar Display
   for (int i = 0; i < 8; i++) {
     for (int j = 0; j < 8; j++) {
       leds[i][j] = 0;
     }
   }
}

void setPattern(int pattern) {
   for (int i = 0; i < 8; i++) {
     for (int j = 0; j < 8; j++) {
       leds[i][j] = patterns[pattern][i][j];
     }
   }
}

void slidePattern(int pattern, int del) {
   for (int l = 0; l < 8; l++) {
     for (int i = 0; i < 7; i++) {
       for (int j = 0; j < 8; j++) {
         leds[j][i] = leds[j][i+1];
       }
     }
     for (int j = 0; j < 8; j++) {
       leds[j][7] = patterns[pattern][j][0 + l];
     }
     delay(del);
   }
}

// Rutina de interrupciones
void display() {
   digitalWrite(cols[col], LOW);  // Turn whole previous column off
   col++;
   if (col == 8) {
     col = 0;
   }
   for (int row = 0; row < 8; row++) {
     if (leds[col][7 - row] == 1) {
       digitalWrite(rows[row], LOW);  // Turn on this led
     }
     else {
       digitalWrite(rows[row], HIGH); // Turn off this led
     }
   }
   digitalWrite(cols[col], HIGH); // Turn whole column on at once (for equal lighting times)
}



Anyway it works but idk where to plug pins into
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24321
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
idk where to plug pins into
Code:
// Pines conectados al Arduino (-1 es un fantasma para que empience en la posicion 1)
int pins[17]= {-1, 5, 4, 3, 2, 14, 15, 16, 17, 13, 12, 11, 10, 18, 8, 7, 6};
Clue?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
// Columnas de leds = Pines de la matriz
int cols[8] = {pins[13], pins[3], pins[4], pins[10], pins[06], pins[11], pins[15], pins[16]};

...

   // Pines en bajo
   for (int i = 1; i <= 8; i++) {
     digitalWrite(cols[i + 1], LOW);
   }

You are exceeding the array bounds by two, here.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well i plugged pins in and nothing happens compied successfully :S i have done this on 2 arduinos
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When you don't understand something, you just ignore it, right? Like my reply #42 above.

And then ten minutes later you make another post complaining that nothing is working.
Logged

Pages: 1 2 [3] 4   Go Up
Jump to: