hello,
I've been stuck for a few days and i cant find the right solution
i need to wrap this :
This is the part from the demo code
what i know is that
*p = a single char
sizeof(cBuf) / sizeof(cBuf[0])= buffer size
cBuf = i dont know from where comes this information
i dont know if i m right:
from b4j side i have to create a byte array and i send every single char to this function but how i came to the cbuf ?
there are other types of data except:
uint8_t is the same as Byte.
uint16_t is the same as UInt.
uint8_t* is the same as ?????
I can not get rid of this error:
error: invalid conversion from 'byte {aka unsigned char}' to 'uint8_t* {aka unsigned char*}'
regards
Andy
I've been stuck for a few days and i cant find the right solution
i need to wrap this :
B4X:
* Load a character from the font data into a user buffer.
*
* Copy the bitmap for a library font character (current font set by setFont()) and
* return it in the data area passed by the user. If the user buffer is not large
* enough, only the first size elements are copied to the buffer.
*
* NOTE: This function is only available if the library defined value
* USE_LOCAL_FONT is set to 1.
*
* \param c the character to retrieve.
* \param size the size of the user buffer in unit8_t units.
* \param buf address of the user buffer supplied.
* \return width (in columns) of the character, 0 if parameter errors.
*/
uint8_t getChar(uint8_t c, uint8_t size, uint8_t *buf);
This is the part from the demo code
B4X:
void scrollText(char *p)
{
uint8_t charWidth;
uint8_t cBuf[8]; // this should be ok for all built-in fonts
PRINTS("\nScrolling text");
mx.clear();
while (*p != '\0')
{
charWidth = mx.getChar(*p++, sizeof(cBuf) / sizeof(cBuf[0]), cBuf);
for (uint8_t i=0; i<=charWidth; i++) // allow space between characters
{
mx.transform(MD_MAX72XX::TSL);
if (i < charWidth)
mx.setColumn(0, cBuf[i]);
delay(DELAYTIME);
}
}
}
what i know is that
*p = a single char
sizeof(cBuf) / sizeof(cBuf[0])= buffer size
cBuf = i dont know from where comes this information
i dont know if i m right:
from b4j side i have to create a byte array and i send every single char to this function but how i came to the cbuf ?
there are other types of data except:
uint8_t is the same as Byte.
uint16_t is the same as UInt.
uint8_t* is the same as ?????
I can not get rid of this error:
error: invalid conversion from 'byte {aka unsigned char}' to 'uint8_t* {aka unsigned char*}'
regards
Andy
Last edited: