espruino / espruinodocs Goto Github PK
View Code? Open in Web Editor NEWSee http://espruino.com for the complete Espruino Documentation - many links in this repository will not work
Home Page: http://www.espruino.com/
License: Other
See http://espruino.com for the complete Espruino Documentation - many links in this repository will not work
Home Page: http://www.espruino.com/
License: Other
If it tries, everything goes to hell, because the handlers (ie for "Unlink"/etc) don't have any provision for determining which socket they are associated with.
It shoud be cool if you could create a new project called tern-espruino which hosts https://github.com/espruino/EspruinoDocs/blob/master/bin/espruino.json and package.json.
It will give yoiu the capability to publish your tern plugin with npm and users will abel to install it with npm.
Thanks!
See here:
http://forum.espruino.com/conversations/1287/
They appear to be running it too quickly now!
If a message doesn't get a reply, the callback gets left in the list. Eventually it'll cause the array of callbacks to fill up all the available memory
I'm not sure why mosfets.md shows up in the devices list on the webside, but EEPROMs.md doesn't.
You can access it at http://www.espruino.com/EEPROMs but there's no link at http://www.espruino.com/Tutorials or http://www.espruino.com/Modules so it's unlikely anyone will ever see it.
Page header reads "CC3000 WIFI MODULE".
I have created a console interface, node library, and grunt task to make interacting with the espruino from a normal file system very easy. Would you have any issue with me adding them to the docs?
Hey there,
just checked the nice gadget on Mac OSX 10.9
The command "paste" failed as it was in need of the filename. If you give "-" as filename it will read the piped data.
As i'm german it was difficult to find another problem, because the decimal point in germany is "," not "." and bc was not able to calculate โฆ maybe a little hint to mention for non experts.
There was a little typo, because the device was missing a "b" in "cu.usmodem"
The complete command that worked for me, besides setting my locale to english, was:
echo -e "draw(ps -A -o pcpu | tail -n+2 | paste -sd+ - | bc
)\n" > /dev/cu.usbmodem*;
Thanks again and awesome work!
Since updating build.js
, we can now do:
Reference
--------------
* APPEND_JSDOC: modulename.js
and can then add simple documentation to each module in the form of:
/** My description
second line if we want it */
FooBar.prototype.hello = function() {
}
/** Another */
exports.woot = function() {
}
See devices/NRF24L01P.js
as an example. We now just need to bash through all the modules and do this.
Note that it doesn't cope with defining functions inside an export.connect
function. Ideas for how to sort that appreciated - but for now it can just be documented in a comment above.
Sometimes, the ESP8266 will refuse to respond to AT+RST, particularly immediately after power-on.
In this case, we should wait a short time, and try again.
Additionally, after a failure like what I was experiencing on the forums, it might make sense for the Espruino to wait a second, then do AT+RST, and then fire a callback to that gets the ESP8266 back into it's old state (maybe just the initial setup callback? ) to try to get it working again.
Per docs:
This is the stream related file IO library.
To use this, you must type var fd = require('fs').open('filepath','flags','mode') to open a file stream.
However, fs.open is not documented, and there's no description of the "flags" argument.
Sure, I could ask, and I remember Gordon saying the default for I2C was 50khz (50000), but AFAIK, nobody's ever asked this about SPI, so god only knows what the default speed for that is.
This is the kind of information that should be listed in the reference, along with the minimum and maximum possible. It's not clear to me how these reference pages are generated, and whether I should be reporting this issue here, or in the main espruino repo.
Basically a page on various ways to use the filesystem, including custom SD card positions.
For instance:
The current behaviour for setInterval is to wait the defined time and then execute the function, until the interval is cleared. Since setInterval is the primary function for periodic events, it might be a good idea to add an option to execute the function immediately instead of first waiting for the defined timeout.
For example, a LED could be set to blink using setInterval, where the option would determine if you want the LED to blink immediately or only after the first timeout occurred.
Hello Gordon,
It's not a big issue at all but I've noticed some style inconsistencies in the device modules i.e. usually it is two spaces for indents, but sometimes it's only one space, and then sometimes it's a mix of them in the same file.
Do you mind if I go through these files and fix it so that it's always two spaces? (in accordance to Espruino/CONTRIBUTING)
should be
var d= foo.readG();
The writeSpad
function uses 'arguments', which is quite slow as every mention of it causes the array to be recreated. It'd be better explicitly labelling each write.
Now we have a Fritzing library for Espruino, we might as well include fritzing circuit diagrams for the tutorials.
In the Pico page, the pinout for the SWD header should be listed. That would, IMO, also be the correct place to mention what (if any) poking is needed to disable SWD and turn those into GPIO pins.
The "samples" argument to Waveform looks weird in many of these examples:
var w = new Waveform(256);
for (var i=0;i<1024;i++) w.buffer[i] = 128+Math.sin(i_Math.PI/128)_127;
Why does the loop go to 1024 when there are only 256 samples in the Waveform?
http://www.espruino.com/InfraredProximity
Needs updating with a simple schematic
Rather than a big 'atob', I'm pretty sure the following:
var s=atob("....");
s+=atob("....");
s+=atob("....");
s+=atob("....");
Would allow more data to be loaded into RAM.
Like is suggested in WS2811
Probably just add it to build.js
. Detect:
* APPEND_JSDOC: file.js
And then shove in JSDoc code created by reading that file. This would really improve documentation - especially as modules get more complex.
The way JS code is written/formatted can have some surprising effects on memory usage and performance, so I think it would make sense if you add some general rules in the "Writing Modules" section.
@ganehag I just had this e-mail:
I have found a bug, the hexdigest() function called to produce a string from a precomputed hmac sometimes wrong
for example
hmac.create("passwordditest", "ETH01", hashlib.sha256).hexdigest();
produces a string of 61 byte length:
4ae1de552d368dd65e45eca75bcfd91c94511e07d4039d441eb222820fc33
but the real output must be
4a0e1de552d368dd65e45eca750bcf0d91c94511e07d4039d441eb222820fc33
Any ideas?
From @Jorgen-VikingGod on June 3, 2015 12:22
would be nice to have OSC support library on Espruino
like this:
https://github.com/CNMAT/OSC
more about this protocoll:
http://opensoundcontrol.org/
Copied from original issue: espruino/Espruino#542
Anyone interested in CAN device driver?
It seems to me at least - and this should be different depending on the thermistor. Maybe an option is needed.
Also 'Thermistors' should probably reference it better, and circuit diagram ought to really show current limiting resistor as optional.
In the "CREATING AUDIO FILES FOR ESPRUINO" section it instructs to save at 4000Hz, but in the double buffer example the sound is played at 11025Hz.
Not sure why, but the first byte (first column of 8) doesn't seem to get written on the PCD8544.
A lot of the functions with IO allow to send a lot of data at once since, as the performance page indicates, there is a noticeable overhead with executing code. Make it possible to send an array of pixel coordinates or even an array filled with the desired colours at each row,col position to make addressing the display more efficient.
The DS18B20 sensor can be read on 1v43, but not on 1v45 or 1v46, where the output is always null.
The documentation for the http currently reads:
This library allows you to create http servers and make http requests
NOTE: This is currently only available in the Raspberry Pi version
This is a cut-down version of node.js's library
Please see http://nodemanual.org/latest/nodejs_ref_guide/http.html
To use this, you must type var http = require('http') to get access to the library
NOTE: The HTTP client + server send in ~8 byte chunks. This is normally fine but big servers - eg. Google will reject requests made like this (DDoS protection?)
When uploading the code to the Espruino i receive the error
Uncaught Error: Field or method does not already exist, and can't create it on undefined
at line 1 col 190
...("MRFC522 Request Error "+a);a=this.r(20);return this.ra(18,...
^
in function "req" called from line 1 col 35
{this.w(26,7);return 0<this.req(38).length}
^
at line 1 col 36
{this.w(26,7);return 0<this.req(38).length}
^
in function "isNewCard" called from line 1 col 17
{this.isNewCard()&&a(this.getCardSerial())}
^
Use a javascript based VM:
http://copy.sh/v86/?profile=linux26
Preload it with git, gcc - arm - embedded, and a script to get latest Espruino and build it.
I tried the lights with the demo code from the documentation, but couldn't get them to work. At first, all I was able to accomplish was getting one light turned on in white instead of red as I wanted to.
After some trial and error I got them working with 6400000 baud instead of 3200000.
I connected the lights to A7 and now this, and other code works:
SPI1.setup({baud:6400000, mosi:A7});
SPI1.send4bit([200,0,20], 0b0001, 0b0011); // pink
Maybe it is a good idea to edit the docs and suggest using 6400000 when 3200000 doesn't work?
Today I wanted to convert a large file, but of course that didn't work because it was simply to large.
The console had thrown me a Uncaught RangeError: Maximum call stack size exceeded
. The file was larger then 20KiB and it didn't leave the "File too long - must be less than 20kB".
That's because it still executes var b64Str = 'atob("'+btoa(String.fromCharCode.apply(null, bytes))+'")';
, when this is too large js will just crash.
I'll make a pull request that fixes this.
The page says this is an I2C connection, but it documents an SPI connection instead
That uses STM32F1Flash/etc to fake an EEPROM using free on-board flash memory
I'm getting 192.168.4.1 as the IP when I do wifi.getIP().
The IP address that the ESP8266 actually gets is 192.168.2.102 (in my case). It seems that it's getting the IP that it would use when acting as an access point, rather than the IP it has as a client. If possible, the ESP8266WiFi module should return the appropriate IP address for the mode the ESP8266 is currently operating in.
Maybe a link to the ULN2003 as well as using a single transistor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.