I'd like to create an array of remote control codes provided by the raw read feature of the irlib2 library.
irlib2 provides the following uint16t arrays using the following format:
#define RAW_DATA_LEN 68
const uint16_t powerOff[RAW_DATA_LEN]={
8550, 4306, 530, 1606, 530, 566, 502, 1610,
530, 566, 502, 574, 506, 1630, 506, 566,
506, 1630, 506, 566, 502, 1610, 530, 566,
502, 1634, 506, 1606, 530, 570, 498, 1634,
506, 570, 510, 562, 506, 566, 502, 1634,
506, 1606, 530, 1610, 530, 562, 538, 538,
530, 542, 538, 1598, 538, 1570, 558, 542,
538, 538, 530, 542, 538, 1598, 530, 1578,
558, 1578, 562, 1000};
I'd like create an array of these arrays using the code below, but get the following errors.
CODE
#define RAW_DATA_LEN 68
const uint16_t powerOff[RAW_DATA_LEN]={
8550, 4306, 530, 1606, 530, 566, 502, 1610,
530, 566, 502, 574, 506, 1630, 506, 566,
506, 1630, 506, 566, 502, 1610, 530, 566,
502, 1634, 506, 1606, 530, 570, 498, 1634,
506, 570, 510, 562, 506, 566, 502, 1634,
506, 1606, 530, 1610, 530, 562, 538, 538,
530, 542, 538, 1598, 538, 1570, 558, 542,
538, 538, 530, 542, 538, 1598, 530, 1578,
558, 1578, 562, 1000};
uint16_t sourceCD[RAW_DATA_LEN]={
8546, 4310, 558, 1578, 562, 538, 498, 1638,
530, 542, 506, 570, 502, 1634, 502, 570,
498, 1638, 534, 538, 498, 1638, 530, 542,
506, 1606, 554, 1582, 558, 538, 510, 1602,
554, 546, 506, 566, 502, 570, 510, 1602,
554, 1582, 558, 538, 510, 566, 502, 1606,
554, 546, 502, 1610, 558, 1574, 554, 546,
502, 570, 510, 1602, 526, 1610, 526, 574,
506, 1602, 526, 1000};
uint16_t sourceAUX[RAW_DATA_LEN]={
8550, 4310, 526, 1634, 506, 566, 502, 1634,
506, 566, 502, 574, 506, 1626, 510, 566,
506, 1630, 506, 566, 502, 1634, 506, 566,
502, 1634, 506, 1606, 530, 566, 506, 1630,
506, 566, 502, 1634, 506, 1630, 506, 1630,
510, 1602, 526, 570, 510, 566, 502, 1634,
502, 570, 502, 570, 510, 566, 502, 570,
510, 562, 506, 1630, 506, 1630, 510, 562,
506, 1630, 510, 1000};
uint16_t sourceCDR[RAW_DATA_LEN]={
8550, 4306, 530, 1606, 534, 566, 502, 1606,
534, 566, 502, 570, 510, 1602, 526, 570,
510, 1602, 534, 566, 502, 1606, 534, 566,
506, 1602, 530, 1606, 534, 566, 502, 1610,
530, 570, 498, 574, 506, 566, 502, 570,
510, 1602, 526, 570, 510, 566, 502, 570,
510, 1602, 526, 1610, 526, 1606, 534, 1602,
534, 566, 502, 1610, 530, 1602, 534, 1602,
526, 574, 506, 1000};
//This is the problem code:
uint16_t sources[3] = {sourceCD, sourceAUX, sourceCDR};
ERRORS
warning: invalid conversion from 'uint16_t* {aka unsigned int*}' to 'uint16_t {aka unsigned int}' [-fpermissive]
uint16_t sources[3] = {sourceCD, sourceAUX, sourceCDR};
warning: invalid conversion from 'uint16_t* {aka unsigned int*}' to 'uint16_t {aka unsigned int}' [-fpermissive]
warning: invalid conversion from 'uint16_t* {aka unsigned int*}' to 'uint16_t {aka unsigned int}' [-fpermissive]
I gather this has something to do with mixing and converting invalid types, but I'm not quite sure where to go from here
sourcesis array of pointers to arrays souint16_t* sources[] = {sourceCD, sourceAUX, sourceCDR};. array variable is a pointer to first member locationwarning: invalid conversion from 'const uint16_t* {aka const unsigned int*}' to 'uint16_t* {aka unsigned int*}' [-fpermissive]I also trieduint16_t *sources[] = {sourceCD, sourceAUX, sourceCDR}. Any other ideas?constand others are not. make allconst. the position of * is not important. you should read the error/warning messages.