Graphics Arduino Due ST7735

Hi there

If I try to add a graphics node I can’t compile the patch, if I removed it no problem to compile. I got that error massage:
grafik

Begin compiling code for the board Arduino Due (Programming Port) :package:

C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookBExvuP\xod_1599591879378_sketch\xod_1599591879378_sketch.ino:1837:5: error: in-class initialization of static data member ‘const unsigned char xod::xod__graphics__temperature_16x16_rgb::Node::icon []’ of incomplete type
};
^

C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookBExvuP\xod_1599591879378_sketch\xod_1599591879378_sketch.ino: In member function ‘void xod::xod__graphics__temperature_16x16_rgb::Node::evaluate(xod::xod__graphics__temperature_16x16_rgb::Node::Context)’:
C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookBExvuP\xod_1599591879378_sketch\xod_1599591879378_sketch.ino:1912:66: error: invalid conversion from ‘const unsigned char*’ to ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16);
^

In file included from C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookBExvuP\xod_1599591879378_sketch\xod_1599591879378_sketch.ino:1081:0:
C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookBExvuP\libraries\Graphics/Bitmap.h:11:5: error: initializing argument 1 of ‘Bitmap::Bitmap(uint8_t*, uint8_t, uint16_t, uint16_t, uint16_t)’ [-fpermissive]
Bitmap(uint8_t* newBuffer = nullptr, uint8_t newColorDepth = 0, uint16_t newWidth = 0, uint16_t newHeight = 0, uint16_t newKeyColor = 0x0000) {
^
I’m using already the xod version 0.35.0

@m-b Hi!
Due to the new update, the c++ implementation of nodes has changed. The documents and case studies need to be updated.
By now, you can rewrite your bitmap according to the following structure.
Example:

nodespace {
    static const unsigned char icon[] PROGMEM = {

    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x39,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x2c,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0x9b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd8,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd3,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x5a,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x56,0x3d,0x4e,0x1c,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0xdc,0x76,0x7d,0x3d,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
    ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x7b,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

    };
}
node {
    Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000);

    void evaluate(Context ctx) {
        emitValue<output_BMP>(ctx, &myBitmap);
    }
}

Hi

many thanks for your support first!
I’ve tried to do what you have mentioned, I also follow you structure with your example too. But no sucess right now!
Even if I copy the full example ist not possibel to compile it.

I’ve got that error:

C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookJSYShZ\xod_1599666808979_sketch\xod_1599666808979_sketch.ino:1904:53: error: invalid conversion from ‘const unsigned char*’ to ‘uint8_t* {aka unsigned char*}’ [-fpermissive]
Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000);
^
In file included from C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookJSYShZ\xod_1599666808979_sketch\xod_1599666808979_sketch.ino:1081:0:
C:\Users\MDHL\AppData\Local\Temp\xod_temp_sketchbookJSYShZ\libraries\Graphics/Bitmap.h:11:5: error: initializing argument 1 of ‘Bitmap::Bitmap(uint8_t*, uint8_t, uint16_t, uint16_t, uint16_t)’ [-fpermissive]
Bitmap(uint8_t* newBuffer = nullptr, uint8_t newColorDepth = 0, uint16_t newWidth = 0, uint16_t newHeight = 0, uint16_t newKeyColor = 0x0000) {
^

Hi @gabbapeople

I downgrade XOD to 0.34 and try to compile the patch ( like mentioned in my first post above) to the DUE. But even in older version it wasn’t posibel to compile and upload the patch.
Now with XOD 0.35.1 I even update the graphics library too, still have exactly the same error like mentioned before.

Have you any idea to solve that?!

@m-b, I’m sorry for this bug. I’ll fix it next XOD update. By, now try this:

Bitmap myBitmap = Bitmap((uint8_t*)icon, 2, 16, 16, 0x0000);

Should work.

Hi @gabbapeople

Thanks that works perfect!
PS. Isn’t it easer to update the graphics library as to update XOD?

Hi @gabbapeople

do you have a prefered tool for converting image into byte c arrays?

@m-b, my choice is:

Rgb:

Bw:

Ditheritng:

I can fix the graphics library, but without official XOD release you will see the changes only in DEV XOD version https://github.com/xodio/xod

It was just a idea for an easy going for you with updating the library.
Right now it works fine for me, I just have the problem to convert it into the right array. I now that it should been two byte with RGB565 but sometimes …