Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: problem when trying to inherit from EthernetClient class on: May 07, 2014, 03:41:07 pm
Ok, I found a solution, my constructor was wrong, the following is working now:

Code:
class LEDMatrixEthernetClient : public EthernetClient {
public:
    LEDMatrixEthernetClient(const EthernetClient &client) : EthernetClient(client) {};
    String getHttpRequest();
};
2  Using Arduino / Programming Questions / Re: problem when trying to inherit from EthernetClient class on: May 07, 2014, 03:12:10 am
... and sorry for the long message by the way. smiley
3  Using Arduino / Programming Questions / problem when trying to inherit from EthernetClient class on: May 06, 2014, 05:10:07 pm
Hello,

I'm trying to create a new class which inherits from the EthernetClient class, in order to add some specific functions to parse http commands for my needs. And I can't manage to have it working.

Initially, I had some code such as:

Code:
void loop() {
  EthernetClient client = server.available();

  if (client) {
     get_http_request(client);

     ....
  }
}

Now, I would like to make the get_http_request() function a method of a new class which inherit from EthernetClient, like:

Code:
class MyEthernetClient : public EthernetClient {
public:
    String getHttpRequest();
};

MyEthernetClient::getHttpRequest() {
...}

And with this the above code would become somthing like:

Code:
void loop() {
  MyEthernetClient client = server.available();

  if (client) {
     cmdString = client.getHttpRequest();
     ....
  }
}

But when doing this, I get following compilation error:
Quote
error: conversion from 'EthernetClient' to non-scalar type 'MyEthernetClient' requested

So then, I tried to do:
Code:
MyEthernetClient client = (MyEthernetClient) server.available();

This time I got following compilation error:
Quote
error: no matching function for call to MyEthernetClient::MyEthernetClient(EthernetClient)

So then, I tried to add a constructor like this in my new class:
Code:
class MyEthernetClient : public EthernetClient {
public:
    MyEthernetClient (EthernetClient client) : EthernetClient() {};
    String getHttpRequest();
};

This time, I got no compilation error, but it just doesn't work as before, the "if (client) {" of the loop function just never succeeds.

Could someone explain me what is the problem in the way I try to extend the base class?

Thanks and regards,
Michael
4  Using Arduino / LEDs and Multiplexing / Re: Individual dimming on 8x8 red matrix on: May 04, 2014, 04:42:11 am
ok, it's clear now, I'll try this out!! smiley

Thanks a lot for your help!
5  Using Arduino / LEDs and Multiplexing / Re: Individual dimming on 8x8 red matrix on: May 03, 2014, 09:36:14 am
Hello, and thank you for your answer.
But I'm not sure I got your point, could you elaborate a little more? smiley

Thanks!
Michael
6  Using Arduino / LEDs and Multiplexing / Individual dimming on 8x8 red matrix on: May 02, 2014, 03:21:24 pm
Hello,

I'm starting a small project with a max7219 and a 8x8 red led matrix, using LedControl library.
I was wondering if there would be a way to control the intensity of LEDs one by one, instead of setting a global intensity as it is available by default in the library? (I mean being able to have one LED to intensity 2, another set to intensity 8 etc...)
Or is there a limitation in the way a LED matrix works?

Thanks and regards,
Michael
7  Using Arduino / LEDs and Multiplexing / Re: Red LED matrix with TLC5940 on: December 27, 2012, 05:58:05 pm
ok, thanks again!! smiley
8  Using Arduino / LEDs and Multiplexing / Re: Red LED matrix with TLC5940 on: December 27, 2012, 02:02:07 pm
ok, I'll let you know for shipping price to France. smiley

One last question, the MAX7219 description on the website you gave me says "Common Cathode serially interfaced display driver".
(http://www.taydaelectronics.com/max7219-7-segment-dot-point-common-cathode-serially-interfaced-display-driver-pdip-24.html)

But I think the matrix is a common-anode one. (not sure though).
Will it work anyway?

Thanks,
Michael
9  Using Arduino / LEDs and Multiplexing / Re: Red LED matrix with TLC5940 on: December 27, 2012, 01:38:36 pm
Hi,

Thanks for you answers! I'm quite disappointed though, I thought it would work with the TLC as I saw several LED projects using it, but seems not as easy as with the MAX7219, which I didn't find at my local store. smiley-sad
I'll check for ordering it, but with shipping to France, it might get quite expensive... anyway... smiley

So with you comments, I got something more or less working by plugging the ROWS to arduino's outputs, and the COLUMNS to the TLC, but it's a bit awkward to use...

Let's go for the MAX7219!

Thanks a lot,
Michael
10  Using Arduino / LEDs and Multiplexing / Red LED matrix with TLC5940 on: December 27, 2012, 12:10:17 pm
Hi all,

I'm just starting playing with a 8x8 red led matrix that I got, my first attempt was somehow successful, but was using all my arduino pins.
So I'm now trying to use a TLC5940 to control the matrix and keep some pins free on the arduino... But it doesn't work! smiley-sad

For the first attempt (without TLC5940), I've just followed the RowColumnScanning tutorial (http://arduino.cc/en/Tutorial/RowColumnScanning), got it working fast, I just add to revert column 4 and column 6 pins, to adapt to my matrix. (I don't have the datasheet of my matrix...), then setting first row to HIGH and first column to LOW was actually lighting my first LED.

Then, moving to TLC5940, I didn't found any simple project example to drive such a simple "one color matrix", but my idea was to use the 8 first outputs of the TLC5940 to set COLUMN values, and the 8 last outputs to set ROWS values in order to be able to control each LED individually. I thought that, using the TCL5940 library form here (http://code.google.com/p/tlc5940arduino/), the following code would do the same effect as when using digitalWrite() in the first attempt:

Code:
Tlc.set(0, 0); // channel 0 is COL1
Tlc.set(8, 4095); // channel 8 is ROW1
Tlc.update();

=> it doesn't work

BUt I I put +5V directly on ROW1, and do Tlc.set(0, 4095), I get the light on first LED...

So I think I've not understood how it should work with the TLC5940....

Is it correct to think that I can control ROWS and COLUMNS with the 16 outputs of the TLC5940?
Then is it supposed to work using the .set() function, as when I was using the digitalWrite with arduino's outputs?

Does anyone as an example of such project?

Thanks a lot!
Cheers,
Michael

Pages: [1]