Well, I'd have said the HMC5883 should work fine. It'd be worth some experimenting.
The digital caliper is an interesting idea - it might also be possible to create your own 'digital linear encoder'... Basically a PCB with a pattern of conductive areas:
# # # # # # # #
## ## ## ##
#### ####
########
You could hack something out of a bit of protoboard, or could even use black markings and those IR reflectance sensors.
Then you just read the 4 'bits' and you have the distance in binary.
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.
Well, I'd have said the HMC5883 should work fine. It'd be worth some experimenting.
The digital caliper is an interesting idea - it might also be possible to create your own 'digital linear encoder'... Basically a PCB with a pattern of conductive areas:
You could hack something out of a bit of protoboard, or could even use black markings and those IR reflectance sensors.
Then you just read the 4 'bits' and you have the distance in binary.