-
-
@SimonGAndrews
Good news- got a pico w
- got it connected from Espruino to my wireless
Bad news - don't get my hands on a http-server. There is a first step in Github, but my understanding is poor. My way right now is a mix of trial/error and copy/paste
BTW, Gordon already offered to help changing from cmake to espruino like make, once the port is kind of stable. For me this port is having some fun, don't have to make money for the family.
- got a pico w
-
Well.. could be me ;-)
May be, this can help for audio output http://forum.espruino.com/conversations/363093/#comment15963863
I used it for some simple speech, but it can be used for sound, music etc.
last not least its cheap. -
@TheLogan
are there any news (even bad news) about your talking hat ? -
@user143733 I sent you a message
-
Save the module in Storage.
See more here http://www.espruino.com/Modules#from-storage -
@fanoush, based on your comments I changed adressing.
Flash.getFree now returns real address in Flash.
Flash.erasePage, .read and .write also use real address and are recalculated to match API
Sideeffect: found and fixed a problem in jshWriteFlash and got save() running.BTW, interest in this port is not really overwhelming ;-)
-
-
@fanoush, thanks for feedback.
Advantage in my eyes is handling of flash.
Moving calculation of real addresses in flash from Firmware to each Javascript project adds burden to the user.
I'm pretty sure only a few guys will know XIP-address, or are willing to search for
Anyway, I don't see the reason for this test.
IMHO testing for negative numbers would be a good solution. -
Some weeks ago, I started a project to get Espruino running on PI Pico (RPI2040)
I had no idea how to do, but gave it a try.
Target was, not to change Espruino code itself, no additional ifdef etc.
Right now I'm somewhere around pre-alpha. Simple version is running.
Development is based on pico-examples, not on Espruino make
https://github.com/jumjum123/Espruino4PicoAs expected tons of problems/question are on the road.
In my implementation flash starts at virtual addr 0, which is translated to 2nd MB in flash
This makes Flash-commands easy to understand. Require("flash") runs fine.
Actual problem, one of a lot is jsfGetFileHeader.
Unfortunally addr is tested with this line: if (!addr) return false which stops some other functions.
Any idea, how to get around without changes in jsflash.c ?BTW, if some body wants to help in this project, you are welcome.
-
Just checked an idea for "format only the selected code" in my environment.
At the end it is extremly easy to implement.
Should be similiar for prettiervar code = Espruino.Core.EditorJavaScript.getCode(); var selected = Espruino.Core.EditorJavaScript.getSelectedCode(); if(selected) code = code.replace(selected,js_beautify(selected,options) + "\n"); //had to add linefeed for beautify, don't know wether prettier needs this else code = js_beautify(code,options); Espruino.Core.EditorJavaScript.setCode(code);
-
@neshanjo great to see what you did. Your point of adding setCursor, great idea.
Looking forward to see a pull request for github ;-)Thanks for your nice feedback. Applause is what keeps artists going ;-)
Beautifier was the first I used and it worked.
At the end, using prettier or beautify does'nt matter (to me).
BTW, could it be an option/help/possible to use prettier for selected code only ? -
@MaBe
thanks but it would need some more work.
For example:- add settings page
- add options based on settings
- is there a better tool, prettier for example ?
- find a better icon
My intention was to give a starting point ;-)
- add settings page
-
@neshanjo
A simple example how to add a formatter.
I used beautifier, because its so easy to add.
And it does not need an internet connection.
Steps:- add a file to js/plugins with following code
- add a script tag in main.html to the new plugin
- add beautify folder in js/libs
- add beautify-file from github into this new folder
add script tag in main.html to beautify-file
"use strict"; (function(){ var iconFolder; function init() { showIcon(); } function showIcon(){ iconFolder = Espruino.Core.App.addIcon({ id: 'formatCode',icon: 'snippets',title: 'Prettyfie',order: 510, area: { name: "code",position: "top"}, click: prettyfie }); } function prettyfie(){ var code = Espruino.Core.EditorJavaScript.getCode(); code = js_beautify(code); Espruino.Core.EditorJavaScript.setCode(code); } Espruino.Plugins.FormatCode = { init : init, }; }());
```
- add a file to js/plugins with following code
-
Implementation of BLE on ESP32 became incomplete.
Know this because most of it was done by me.
Espressif changed ESP-IDF and specially BLE a lot with each new (sub) version.
Last not least there was no support by Espressif for Espruino over the years.
Therefore my decision was to concentrate on other targets. -
Defining the property would loose documentation.
And it would not be available in jswrapper.c, whatever this means at the end.
AFAIK, calling jswrap_object_defineProperty expects a JS function for get/set, correct ?
Let me give another example, getPixel and setPixel, myGraphics.pixel(x,y) = newColor and var pixelcol = myGraphics.pixel(x,y) , how can I do this ?
At the end, there are lot of ways to do this, but to me it looks more elegant to set/get :-)Line 452 in jswrap_object.c has this in JSON-definition for defineProperty
And it takes its way to reference you sent, see note at the end
Note: configurable, enumerable, writable, get, and set are not implemented and will be ignored. -
To take Graphics as an example only.
My intention is not to change Graphics. But in myownClass it would be nice to have.
We have functions to set bgColor and to get bgColor.
Is there a way to define a writeable property in jswrap_xxx file ?
So instead of using myGraphics.setBgColor(newColor); it would be myGraphics.BgColor = newColor;
And instead of var x = myGraphics.getBgColor(); it would be var x = myGraphics.BgColor;
Following API-description for Object.defineProperty, writeable and get/set are not supported.
Hmmm, but in jswrap_object_defineProperty get and set are used to create getter and setter -
Could this be something for you ?
http://forum.espruino.com/conversations/363093/#comment15963863 -
Take a closer look at this:
http://www.espruino.com/Extending+Espruino+2
http://www.espruino.com/Extending+Espruino+1another example how to build extensions is here
https://github.com/jumjum123/EspruinoExtensions/tree/master/General/LEDBoard
There are some unusual args used for make -
-
-
-
strange behaviour with color.
With source below, text is blue and rect is green
Looks like drawString expects color from 1 to 8 and drawRect expects 0 to 7require("Font8x16").add(Graphics); var grf = Graphics.createArrayBuffer(128,32,4,{interleavex:true}); grf.setBgColor(0); grf.clear(); grf.setFont("8x16",size); grf.setColor(2); grf.drawString("my test",10,5);´ grf.drawRect(0,20,127,24);
-
Modul is this
https://de.aliexpress.com/item/32666340925.html?spm=a2g0s.9042311.0.0.38ad4c4dMBzc5s
I've no idea about the chip itself.
Manual is here
https://cdn.instructables.com/ORIG/FGT/H5J3/IUKEZCYF/FGTH5J3IUKEZCYF.pdf
Looks like on each call of graphicsGetFromVar, graphicsSetCallbacks is called.
So its called very often.
My expectation was to set callbacks (fillRect, setPixel) only once during initialisation.
This would add an option to write my own drivers in C, which only set fillRect and setPixel.