Yes I have just figured this out my self hehe, I wrote this in javascript thinking I could directly port it onto a micro because I had heard of them running javascript I should of done a bit more research hehe.
My current plan is to rewrite all canvas code (I only use drawImage and fillRect) my self as byte arrays (very similar to Gordans graphics libary)
I will slightly adjust my textManager to draw the font to the byte array canvas and instead of using drawImage (I was only use this as a canvas copy) I will create a canvasCopy method to copy chunks of one byte canvas to another.
canvasCopy(orig,x,y,w,h,dest,x,y,h,w);
This way I will now not be reliant on any canvas object and could very easily port this to plain .c if I needed to.
My plan for the byte canvas (based on my pinDMD project) as I only need 3 colours I can get away with just (192*32*2)/8 = 1532 bytes canvas array which will save on memory. But then again creating a canvas which support 255 colours (192*32)*8 = 49151 bytes is bit larger and would be better in-case i want to use more colours?
I would convert this larger canvas byte array down to the compressed 4 colour version when sending data over i2c to the dmd controller :)
I would also need to swap out the way my code makes http requests with the wifi hardware ones espruino.
If I can get the core of this project just written in pure javascript I think I will be ok and can have a minifier create a web version and a espruino / or node js version (my code is in multiple files so this all needs to be put into one anyway I guess to work with espruino or node.
Thanks for the help offer I will certainly take you up on that when I get stuck hehe :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hey allObjects
Yes I have just figured this out my self hehe, I wrote this in javascript thinking I could directly port it onto a micro because I had heard of them running javascript I should of done a bit more research hehe.
My current plan is to rewrite all canvas code (I only use drawImage and fillRect) my self as byte arrays (very similar to Gordans graphics libary)
I will slightly adjust my textManager to draw the font to the byte array canvas and instead of using drawImage (I was only use this as a canvas copy) I will create a canvasCopy method to copy chunks of one byte canvas to another.
canvasCopy(orig,x,y,w,h,dest,x,y,h,w);
This way I will now not be reliant on any canvas object and could very easily port this to plain .c if I needed to.
My plan for the byte canvas (based on my pinDMD project) as I only need 3 colours I can get away with just (192*32*2)/8 = 1532 bytes canvas array which will save on memory. But then again creating a canvas which support 255 colours (192*32)*8 = 49151 bytes is bit larger and would be better in-case i want to use more colours?
I would convert this larger canvas byte array down to the compressed 4 colour version when sending data over i2c to the dmd controller :)
I would also need to swap out the way my code makes http requests with the wifi hardware ones espruino.
If I can get the core of this project just written in pure javascript I think I will be ok and can have a minifier create a web version and a espruino / or node js version (my code is in multiple files so this all needs to be put into one anyway I guess to work with espruino or node.
Thanks for the help offer I will certainly take you up on that when I get stuck hehe :)