Hi - yes, it could definitely be tweaked. I guess you'd want 1.234 to effectively put the dot on the 1 digit?
Can you try adding this code after you have initialised the MAX7219 and trying again?
disp.set = function(val) {
spi.write([0x9,0xff],cs); // decode all as numbers
var map = "0123456789-EHLP ";
var a = new Array(8);
a.fill(15); // all off
val = val.toString();
var hadDot = false;
var j = 7;
for (var i=val.length-1;i>=0;i--) {
if (val[i]!=".") {
if (j>=0)
a[j--] = map.indexOf(val[i]) | (hadDot?128:0);
hadDot = false;
} else hadDot = true;
}
for (i=0;i<8;i++)
spi.write([8-i,a[i]],cs);
spi.write([0x0c,1],cs); // no shutdown
};
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.
Hi - yes, it could definitely be tweaked. I guess you'd want
1.234
to effectively put the dot on the 1 digit?Can you try adding this code after you have initialised the MAX7219 and trying again?