-
• #2
Hi - thanks for letting me know... so it just crashes on the 'compass' call?
Does it return after a few seconds? It could be it's having some difficulty communicating over I2C, but it should time out.
The micro:bit is a lot slower than normal Espruinos, so it could be that the timeouts are way longer than they should be and it could take up to a minute to return.
It does seem like there's an issue with the code that reads from the compass though, even if it's only that it's giving dodgy values. I'll file an issue for it, but I'm a bit busy this week.
If you desperately need it, you should be able to get the compass values directly:
I2C1.writeTo(0x0E,1); var d = I2C1.readFrom(0x0E,6); // then data is in 6 bytes in d (i think)
-
• #3
I don't have a Micro:bit up to now but I've read that the magnetometer chip in the Micro:bit is the MAG3110 from Freescale. We have an Espruino module for the MAG3110 which supports all features of the sensor (e.g. different operation modes). It's fully tested with a MAG3110 evaluation board.
@Stev
If the Micro:bit has enough memory for using the MAG3110-module then you could experiment with this. -
• #6
Ahh, that makes sense then.
I just fixed it, so any new builds (and 1v86 when released) will have it working.
-
• #7
Cool.
Nice little BLE toy/tool. -
• #8
Solved in 1.86. confirmed.
-
• #9
Great - thanks!
Hey,
just received my microbit and while typing along (really easy espruino install, btw) I found that repetitively calling compass() creates nonsense result and soon gets stuck at
like so:
Saw that too? Not sure if its some device data underflow or a missing reset, as I haven't looked at any internals so far.
Cheers
Stev