Reading values from DmxMaster.h library

Hello all:

I am writing a sketch where I need to know the current values of DMX channels to fade to new values.

I see that the DmxMaster.h library:

has a

DmxMaster.write(channel, value);

function where I can write a new value.

But there is no function to read the value back from the internal dmx buffer I need something like:

uint8_t getChannelValue ( uint16_t index )
{
    if (index < DMX_SIZE)
        return dmxBuffer[index-1];
    else
        return 0x0;
}

I have been trying to extend the library class to no avail....I am a C programmer not a C++ programmer

Can somebody help me?

Thank you

Since it's your code that would be doing the channel writes, presumably you would know the last value written to each channel.

the values come from an external program on another computer, and having another array with 512 bytes in memory is not feasible as my arduino uno is low on memory already.

The library has a 512 byte array holding those values

volatile uint8_t dmxBuffer[DMX_SIZE];

I only want to know how to use inheritance to access that array without modifying the original library

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.