-
• #2
That looks like a really neat display!
It'd be great to see the library - ILI9341 is used in the STM32F429I discovery board too, and I had a quick play with that but without much success.
There's actually some internal support for ILI9320/25/28/31 chips when they're connected in parallel, but not for them when connected via SPI. It'd be great to get that changed as I reckon it'd bump the speed up a lot.
wrt fillRect - can you give an example? Looking at the code, fillRect uses the foreground colour (as it doesn't take a colour argument) - I can't see any real issues there and I have used that callback for the OLED display driver and it seems to work fine...
As for the font - we've covered that elsewhere. I think a built-in 'bitmap' class would solve this and would allow people to use icons and things as well. There's a bug for it here: https://github.com/espruino/Espruino/issues/198
Either that or maybe we could make the vector font thinner. Also, if the size of that font could be packed down, we'd have space for a different bitmap font as well.
-
• #3
drawing is done like this
graphics.setColor(0,1,0); graphics.fillRect(70,70,120,100); graphics.setFontVector(12); graphics.drawString("Espruino",0,0);
inside my module graphics are created like this:
me.graphics = Graphics.createCallback(240,320,16,{ setPixel:function(x,y,c){setPixel(x,y,c);}, fillRect:function(x1,y1,x2,y2,c){fillRect(x1,y1,x2,y2,c);} });
And fillRect is doing this:
function fillRect(x1,y1,x2,y2,c){ console.log(x1,y1,x2,y2,c);
which returns this:
70 70 120 120 undefined
2 11 2 12 2016
3 10 3 12 2016
In my best understanding:
drawing rects from drawString send color as 5th parameter
same from fillRect does not use the color parameter -
• #4
Ahh, thanks for the info....
>g ={ "setPixel":function (x,y,c) { ... }, "fillRect":function (x1,y1,x2,y2,c) { ... } }
So fillRect gets automatically defined in Graphics, and it overloads the built-in fillRect function :( I'll fix that for 1v56.
-
• #5
just getting a white screen nothing else is displayed.Need help with the program and connections.
1 Attachment
-
• #6
Are you using the ILI9341 module and example code? http://www.espruino.com/ILI9341
Also, what board are you using? It looks more like an mbed than an Espruino?
I've got a small and cheap(about 5 € at banggood) TFT Display with ILI9341 up and running.
Its based on sources from Peter Drescher.
At least for displaying it works fine, except:
There are some more options like change orientation and an SD card.
As soon as I get it stable, I will create a module.