Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumWiring HardwareTangible computing › RGB Led Matrix

Page Index Toggle Pages: 1
RGB Led Matrix (Read 7069 times)
05/23/08 at 11:36:48

gokce   Offline
YaBB Newbies

Posts: 12
*
 
Hi, I am trying to get RGB Led Matrix backpacks from Sparkfun to work with Wiring. They worked with Arduino with the example code at:
www.arduino.cc/playground/Code/RGBBackpack
When I try the same code with Wiring, it doesn't work.

I don't have much knowledge about SPI/SPSR and I am not sure if both cards use same or different methods.

I know guys at Halfmachine.dk made them work so it is possible.

Thank you,
 
IP Logged
 
Reply #1 - 05/23/08 at 18:35:26

gokce   Offline
YaBB Newbies

Posts: 12
*
 
I think in order to make it work I have to figure out Wiring's MISO, MOSI, SCK and SS pins. I wasn't able to find Wiring schematics on the internet, so is there anyone who knows these pins, maybe Hernando?
 
IP Logged
 
Reply #2 - 05/23/08 at 20:58:12

Alan_Kilian   Offline
Full Member
Wiring? It looks like
Java to me.

Posts: 118
***
 
The schematics are here: http://wiring.org.co/download/index.html

The important pins are:
Port 3 pin 0 (processor pin 10) *Slave-select
Port 3 pin 1 (processor pin 11) SCK
Port 3 pin 2 (processor pin 12) MOSI
Port 3 pin 3 (processor pin 13) MISO
 
IP Logged
 
Reply #3 - 05/24/08 at 01:17:46

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Here is the code and documentation for the Ladies and Mens room mixup project: http://halfmachine.dk/posts/60
in there you´ll find a link with the Wiring code of the project which uses the sparkfun backpack RGB led matrix. I´ll add an example soon.
Best, H.

These 3 functions are the core of using the display (you can use any 3 Wiring pins with the display):

int bits[8] = {
  128, 64, 32, 16, 8, 4, 2, 1 };


int clock = 16;   // pin SCK del display
int data = 18;    // pin DI del display
int cs = 19;      // pin CS del display

void drawFrame(byte frame[8][8]) {
  digitalWrite(clock, LOW);  //sets the clock for each display, running through 0 then 1
  digitalWrite(data, LOW);   //ditto for data.
  delayMicroseconds(10);
  digitalWrite(cs, LOW);     //ditto for cs.
  delayMicroseconds(10);
  for(int x = 0; x < 8; x++) {
    for (int y = 0; y < 8; y++) {
     writeByte(frame[x][y]);  //Drawing the grid. x across then down to next y then x across.
     delayMicroseconds(10);
    }
  }
  delayMicroseconds(10);
  digitalWrite(cs, HIGH);
}

//prints out bytes. Each colour is printed out.
void writeByte(byte myByte) {
  for (int b = 0; b < 8; b++) { //converting it to binary from colour code.
    digitalWrite(clock, LOW);
    if ((myByte & bits[b])  > 0) {
     digitalWrite(data, HIGH);
    }
    else {
     digitalWrite(data, LOW);
    }
    digitalWrite(clock, HIGH);
    delayMicroseconds(10);
    digitalWrite(clock, LOW);
  }
}


void matrixInit() {
  pinMode(clock, OUTPUT); // sets the digital pin as output
  pinMode(data, OUTPUT);
  pinMode(cs, OUTPUT);
}
 
IP Logged
 
Reply #4 - 05/26/08 at 12:17:23

gokce   Offline
YaBB Newbies

Posts: 12
*
 
Thank you,

Right after my first post I sent an e-mail to Halfmachine and they sent me a similar code. It works now. It looks like they simulated the clock with some delays.

I am using RGB led matrixes with Xport. Here is my project's website:
www.gokcetaskan.com/colortv

When I am done with this project I might help with Xport code. I see that you added it to the learning section.

Best,
Gokce
 
IP Logged
 
Page Index Toggle Pages: 1