-
-
Great, just tested nightly build and it works fine.
What I'm doing now is to use something like this:
- copy my modules to sdcard in folder node_modules
- use require by variable not by string to avoid loading from WebIDE
clear modules after running my init procedure
var b,n; n = "myModule"; b = require(n).connect(...... // do a lot of functions b = ""; //to delete the object created during require Modules.removeCached(n); // do whatever is used after initialization
Next test will be to split an application into modules which are loaded and unloaded by a main application.
- copy my modules to sdcard in folder node_modules
-
There may be a misunderstanding. I want to free memory.
Starting with this:var g = require("ILI9341").connect(SPI2,C6,C7,C8,function(){g.clear();});
Process.memory() returns usage 329
Dump shows var g = { ..... digitalWrite(C6,1....
Result is as expectedg = "";
Process.memory() returns usage 331
dump shows var g = ""; digitalWrite(C6,1.....
I expected less memory usageModules.removeAllCached();
Process.memory() returns usage 330
dump shows var g = ""; digitalWrite(C6,1.....
I expected less memory usage
Tried to do this:var b = "ILI9341"; g = require(b).connect(....
returns unable to read file no path
Process.memory() still returns usage 332
There is no object, no module, so how do I get rid of memory consumption ? -
-
-
-
@Kalus, could you please share the driver ? I still have one somewhere in my big box.
-
-
I used the tutorial mainly to have a first starting point.
Which is assign code to button pressed.
Its a small keyboard having numbers, arrows and an ok button only.
Plan is to use it for my garden to direct something like a waterpistol.
For that 2 servos will be used. One day next summer, it will be up and running, thats the plan. -
Not that cheap, but still a good price is this Display for less than 5€ including delivery.
I had to wait about 4 weeks for delivery.
I have a module ready for that, it works fine on SPI. -
-
-
-
I still have problems with the connection between my windows 8 and Espruino.
It is still the same problem, as in the video (see answer #4 in this conversation).
Upgrading to actual WebIDE from Github and actual image did not help.
Another strange behaviour entered the world:- created an object for TFT display with ILI9341, which works fine, as long as it is sent via slowmode
- added a line to convert into a module. Someting like
exports.connect = function(){ return new ILI9341(); }; - by calling this module with
d = require("ILI9341").connect();
nothing happens anymore. The board does not respond anymore, I have to reconnect to get it back to work, and sometimes even have to reset.
If I copy this commend to the terminal window it works fine.
Before I forget, there is a require of "fs" inside the object, does this confuse anything if inside a required module ?
- created an object for TFT display with ILI9341, which works fine, as long as it is sent via slowmode
-
I would like to control my Espruino with one of those cheap remote controls(used for TV etc.).
Is there any experience with that, or a good startingpoint ?
There is something available on Arduino, but my knowledge is poor on that.
BTW, thats why I love Espruino, Javascript is much nicer, at least for me. -
During development for ILI9341 display, I got timeout on SPI RX once a minute. Used baudrate 1000000 for first steps.
Right now the baudrate is set to 320000 and its working fine now (at least it works for some minutes now.
Is there any guideline or testing environment to select best baudrate ?
BTW, as far as I can see, speed of the application is the same with both baudrates. -
-
-
-
I just try to save a font on SD and read it back.
First I created an array like
font = new Uint8Array(2404); //found this here http://mbed.org/users/dreschpe/code/TFT_fonts/file/76774250fcec/Arial12x12.h
Next assigned Fontdata to this font.
BTW, also tried to write this font as a variable and ran into out of memory.
Saved this to SD by- fs.writefile("font12.txt",font);
- fs.writefile("font12.json",JSON.stringify(font));
I can read this by:
t = fs.readFile(filename);
But from this moment on I cannot create a new Uint8Array from the string.
Tried this with both files. - t = JSON.parse(fs.readFile(filename));
- t = fs.readFile(filename); f2 = eval(t);
- tried to create a new string to be prepared to eval
- tried to split the string
- and a lot of other combinations
I ran into different problems like - nothing happened
- out of memory
- total crash, where I had to reset
What I would like to do is:
Read the file, store it to flash and use it from there.
Any idea how to do better ?
- fs.writefile("font12.txt",font);
-
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 -
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:- fillRect gets color undefined, if fillRect is called. Color is fine if vector font is used for drawString.
- vector font in Espruino seems to be a bold font, which makes it hard to read. Bitmap font is far too small for a 2.2" display with 240*320
There are some more options like change orientation and an SD card.
As soon as I get it stable, I will create a module.
- fillRect gets color undefined, if fillRect is called. Color is fine if vector font is used for drawString.
-
-
Problem happens on old and new Web IDE for me too.
BTW, flashing works fine at high speed in both versions.
Throttle makes flashing horibbly slow, 30 minutes instead of seconds.
So I take the same way Sacha does.