-
-
Can someone please explain the build option RELEASE=1 ?
found those lines in Makefile:
# RELEASE=1 # Force release-style compile (no asserts, etc)
ifdef RELEASE
# force no asserts to be compiled in
DEFINES += -DNO_ASSERT -DRELEASE
endifmake and sdk 2.0 with USE_NET=1 USE_TELNET=1 USE_GRAPHICS=1 USE_CRYPTO=0 and RELEASE=1
user1.bin uses 473876 bytes of 479232 availablemake and same setting but without RELEASE=1
** user1.bin uses 489364 bytes of 479232 available
espruino_esp8266_user1.bin too big! -
-
-
-
right to left works too for a ring ;-)
function rotateRight() { array.unshift(array.pop()); array.unshift(array.pop()); array.unshift(array.pop()); }
you mean using a matrix NxM and rotate the hole lines horizontal or vertical like scrolling in a loop ?
Here are two new things for you Rotating Neopixel with trailer effect
and Adafruit Neopixel ringlight for close-up photography
- what do you think ? -
-
now using a version that returns an array of ids
var isDevice = function isDeviceOnBus(i2cBus,id) { try { return i2cBus.readFrom(id,1); } catch(err) { return -1; } }; var detect = function(i2c,first, last) { first = first | 0; last = last | 0x77; var idsOnBus = Array(); for (var id = first; id < last; id++) { if ( ! isDevice(i2c,id) ) { idsOnBus.push(id); } } return idsOnBus; }; I2C1.setup({sda: D4, scl: D5} ); console.log(detect(I2C1));
-
ok - I understand - first point is the best ;-)
I prefer to have JS solutions ;-)
A idea to use 3 time shift came from a snippet tve gave me, this can be used to rotate / walk like this small sample shows:
// large ring with 24 NPs var NPs = 24; var array = new Array(NPs*3).fill(0); array[0] = array[1] = array[2] = 32; function rotate() { array.push(array.shift()); array.push(array.shift()); array.push(array.shift()); }
-
@JumJum any reason for not writing a java script module to handle this ?
-
Thanks - that was quick ;-)
This is what a verbose curl call gets when adding valid header data:
< HTTP/1.1 200 OK < Date: Sun, 04 Sep 2016 04:00:02 GMT < Server: Apache/2.4.18 (Ubuntu) < Content-Length: 123 < Vary: Accept-Encoding < Content-Type: text/html; charset=UTF-8 < * Connection #0 to host httptohttps.xyz left intact { "data": { "inside":false, "enter":{ "Distance":0.046, "Bearing":336.5 }, "origin":{ "Distance":0.049, "Bearing":328 }}, "error":null }
-
@Ducky like to use this httptohttps.xyz to access fencer.io
Fencer is working with data in header and returns json.
so like to try the bridge with curl to find if a position is in a fence like this:
curl \
-H "Authorization: {API Key} " \
-H "Lat-Pos: {Latitude coordinate} " \
-H "Lng-Pos: {Longitude coordinate}" \
http://httptohttps.xyz/https://api.fencer.io/v1.0/position/status/{access key}Can the bridge handle something like this ?
Next step is to use js on espruino ;-)
-
@JumJum the githup link show 404 , can you please update
-
@allObjects btw - now reading Cross-cutting_concern to understand what you pointed out:
to show the separation of concerns: model / data separate from presentation.
-
-
@Gordon are you thinking of an implementing of DateFormatter in Espruino as native code ?
-
@allObjects - thanks for sharing !
-
@allObjects: wow - great stuff - looks like you coded your own date.js and more ;-)
my intention is to code a small and simple helper to get a human readable date/time
a little change for a shorter the length checker:
//var HH = this.getHours().toString(); //HH = HH.length > 1 ? HH : '0' + HH; var HH = ("0"+this.getHours().toString()).slice(-2);
-
would something like this make sense to be a part of Espruinos Date() class ?
Date.prototype.toDateString = function(format) { /* yyyy Year, long form (e.g., 2016). mm Numeric month, a number from 1 to 12. dd Day, a number from 1 to 31. HH Hour, a number from 0 to 23. MM Minutes, a number from 0 to 59. ss Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds). */ if (format) { // yyyy var YYYY = this.getFullYear().toString(); format = format.replace("yyyy",YYYY); // mm var mm = (this.getMonth() + 1).toString(); mm = mm.length > 1 ? mm : '0' + mm; format = format.replace("mm",mm); //dd var dd = this.getDate().toString(); dd = dd.length > 1 ? dd : '0' + dd; format = format.replace("dd",dd); //HH var HH = this.getHours().toString(); HH = HH.length > 1 ? HH : '0' + HH; format = format.replace("HH",HH); //MM var MM = this.getMinutes().toString(); MM = MM.length > 1 ? MM : '0' + MM; format = format.replace("MM",MM); //SS var SS = this.getSeconds().toString(); SS = SS.length > 1 ? SS : '0' + SS; format = format.replace("SS",SS); return format; } else { format = this.toString(); } }; >Date().toDateString(); ="Tue Jul 19 2016 08:13:46 GMT+0000" >Date().toDateString("yyyy.mm.dd HH:MM:SS"); ="2016.07.19 08:13:12"
-
@ExperimentalZeros if you like you can use slice to convert uint8Array to Array
x = new Uint8Array([113, 39]); =new Uint8Array([113, 39]) y = [].slice.call(x); =[ 113, 39 ]
-
-
Yes - indeed - I do not use USE_CRYPTO=0 to disable crypto
this is what I do:
change a line in Makefile:
#USE_CRYPTO=1