Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / LED matrix loading frames from SdFat on: June 21, 2013, 10:33:21 am
Just thought I'd post one of my recent projects, an LED table top using 2 Adafruit LED strips in a matrix, an Arduino and a SeeedStudio SD shield.

http://www.unmaintained.com/index.php/maker-wedding-animated-arduino-led-matrix-lounge-table-top/

It reads animation files created for the 1E Disco Dance Floor on demand from an SD card. The files are frames of 32x16 animations, the code reads 7x7 of a single frame, sends it to the LED matrix, then reads the next. Hope this helps or inspires! Cheers.
2  Using Arduino / Storage / SdFat Read Error Troubleshooting on: May 10, 2013, 08:31:11 am
Hiy'all,

Using the SdFat library to read some files. Everything works fine, except some files won't read at all (trigger the "failed" error) and there are just seemingly random failures here and there. Is there some way I can make this more robust? It's just .read() and .seekSet() which I try to skip if they aren't successful so I'm not sure why it would fail. I tried putting in some delay between .read() but it didn't help. It's for an LED table top, I'm reading some animations off the SD card, I'll post a project page when it's done.

Code:
void setup() {
  Serial.begin(9600);
  randomSeed(analogRead(0));
  delay(400);  // catch Due reset problem
  if (!sd.begin(chipSelect, SPI_FULL_SPEED))
    sd.initErrorHalt();

  file = files[random(fileCount)];
 
  strip.begin();
  strip.setPixelColor(0, 0, 0, 0);
  strip.show(); 
}

void loop() {

  rep = rep + 1;
  if(rep > reps)
  { 
    rep = 0;
    file = files[random(fileCount)];
    Serial.println(file);
  }
   
  if (!myFile.open(file, O_READ)) {
    // error
    sd.errorHalt("failed");
    // sd.begin(chipSelect, SPI_HALF_SPEED);
    rep = 100;
    return;
  }

  int data;
 
  int column = 0;
  int row = 0;
  int frame = 0;
 
  while ((data = myFile.read()) >= 0)
  {
    // read red
    int r = data;
    delay(.5);
    // read green
    if((data = myFile.read()) < 0)
      break;
    int g = data;
    delay(.5);
    // read blue
    if((data = myFile.read()) < 0)
      break;
    int b = data;
   
    // set pixel address
    byte address = addressMatrix[row][column];
    // set pixel color
    strip.setPixelColor(address, r, g, b);
   
    // next column
    column = column + 1;
   
    // all the columns we need for this matrix
    if(column > ledcols)
    {       
      // reset column count
      column = 0;
      // increment row
      row = row + 1;
     
      // seek to row (skip extra pixels)
      if(myFile.seekSet((frame*framesize)+(row*rowsize)) == 0)
        break;
     
      // all the rows we need for this matrix
      if(row > ledrows)
      { 
        // turn off first pixel (7x7 matrix, 1 unused pixel)
        strip.setPixelColor(0, 0, 0, 0);
        // send current frame to strip
        strip.show();
       
        // reset row count
        row = 0;
        // increment frame
        frame = frame + 1;
       
        // pause for animation speed
        delay(delaytime);
       
        // seek to next frame
        if(myFile.seekSet(frame*framesize) == 0)
          break;
      }
    }
  }
 
  // close the file
  myFile.close();
}
3  Community / Exhibition / Gallery / Re: Smooth animation with an 8x8 RGB LED matrix on: April 28, 2013, 08:42:32 pm
@mkl0815 did you ever manager to port this? I've tried to make this library independent but it seems to rely on the colorduino libraries. All I need is to be able to define the columns and rows and get r,g,b for each pixel. Haven't had any luck so far, if I remove the colorduino library reference everything goes to pot.

@giladaya: Could it be, that you swapped columns and rows ( width and height) in you code?
I'm currently trying to port your "fire"-code to a WS2812 LED strip with 6 columns ( 6 pixel width) and 8 rows (8 pixel hight).

As I understand your code, the function "generateline()" creates a new pixel-line on the bottom line of the matrix. But your code says:
Code:
/**
* Randomly generate the next line (matrix row)
*/
void generateLine(){
  for(unsigned char x=0;x<ColorduinoScreenHeight;x++) {
      line[x] = random(64, 255);
  }
}
So you are using "x" for the position of the "cursor" on the line, but you use the ColorduinoScreenHeight as upper border.
This is not a problem, as long as you use this nomenclature consistently and yout matrix has exactly the same number of rows and columns.
Problems start if the number of columns and rows differ.
Another point is the declaration of the mask-Arrays (valueMask[ColorduinoScreenWidth][ColorduinoScreenHeight] and hueMask[ColorduinoScreenWidth][ColorduinoScreenHeight])
Mario.
4  Using Arduino / Displays / Re: Arduino Nano and I2C LCD problems on: January 05, 2013, 10:46:11 am
It was 0x27, to get everything working I had to use an older version of LiquidCrystal_I2C linked on the DFRobot product page for this i2c LCD 2004, after swapping that library in, using pull-up resistors and pin A4 and A5 of the v3.1 nano the LCD works as expected.

http://www.dfrobot.com/index.php?route=product/product&filter_name=2004&product_id=590
5  Using Arduino / Displays / Arduino Nano and I2C LCD problems on: January 04, 2013, 11:37:44 am
I'm having trouble driving a 20x4 I2C LCD. I'm new to I2C and am finding some conflicting information regarding the Arduino Nano as to what pins are the I2C pins. I've got a version 3.1 Nano, some info says A4 and A5 are the I2C pins, other info says pinout has been reversed and it's A2 and A3.

The  LCD lights up but the I2C LCD Library "Hello World" doesn't show. I've also read conflicting information about a pull up needs to be enabled on the pins or perhaps is through the library? So my questions are, which pins do I use, do I have to alter the defaults in the I2C library or Wire library, if so where are those defaults (I couldn't see them).

It's not the contrast pot and I'm using the address marked on the back of the I2C on the LCD, 0x27.  Thanks.
6  Using Arduino / Project Guidance / Re: HD44780 LCD Signal Piggyback/Sniffing/Reverse Engineering on: April 24, 2012, 02:33:18 pm
The ribbon has ~96 leads and the LCD matrix itself looks to be 20 (pixels?) high by 80 wide. Any ideas what the test array might yield or the 8 point connection on the other side?
7  Using Arduino / Project Guidance / Re: HD44780 LCD Signal Piggyback/Sniffing/Reverse Engineering on: April 24, 2012, 10:24:32 am
*Sigh* The device arrived, a keypad with an LCD display. This is what the LCD controller board looks like,





The info on the board looks to be,

RoHS TM162B9DCWU6 P-4 2006 05

On the bottom of the LCD casing it reads,

201001201409 08/10 TM16B9DCWU6(0-7) 7000051

Can anyone shed some light on this? 18 pins on the test interface, 24 leads on the bottom which connect to the main board and 8 on the side which aren't used. Seems now like this is a custom LCD. Any ideas as to where to start? It would be tedious, but would intercepting the ribbon and mapping out the LCD segments be the simplest (though easy to wreck the LCD that way too)?
8  Using Arduino / Project Guidance / Re: HD44780 LCD Signal Piggyback/Sniffing/Reverse Engineering on: April 17, 2012, 12:32:21 pm
I was hoping to just use an Arduino with some hook-up wires, I'll have to do more research into latching if I'm to attempt that. Thanks for the insight.
9  Using Arduino / Project Guidance / HD44780 LCD Signal Piggyback/Sniffing/Reverse Engineering on: April 17, 2012, 11:14:34 am
Hey,

I've thought of this solution for a number of projects -- currently I'd like to read a 2x16 LCD, I'm hoping it's going to be an HD44780 so I'm working with that. Basically it's a device I want to read the output from and this seems like the easiest way. I can think of three approaches (aside from a camera and character recognition),

- I've read that the HD44780 can be set to dump it's current display to an output, would it be feasible to use this without having control of the device sending it commands?
- Piggyback the lines controlling the LCD and decode the commands live without interrupting the signal
- Intercept the interface completely using an Arduino to emulate the display and decode the commands (with the option of re-displaying the same output using the Arduino)

Has anyone done something similar or have any advice to offer? Between figuring this out and interfacing with some buttons one could make a huge number of devices remote operable.

Phil
Pages: [1]