Odd about the I2C - have you tried different micro:bits? I guess it's possible yours has a dodgy connection?
For show, it's tricky - Math.pow will be using floating point, and I believe the truncation (rather than rounding) is the correct thing to do. The micro:bit has so little memory I believe I'm using a simpler Math.pow that's not quite as accurate, which might account for the problem. I'm not sure there's an easy fix (short of just hacking show to round when it gets an FP number).
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.
Odd about the I2C - have you tried different micro:bits? I guess it's possible yours has a dodgy connection?
For
show
, it's tricky - Math.pow will be using floating point, and I believe the truncation (rather than rounding) is the correct thing to do. The micro:bit has so little memory I believe I'm using a simplerMath.pow
that's not quite as accurate, which might account for the problem. I'm not sure there's an easy fix (short of just hackingshow
to round when it gets an FP number).