I have connected puck to an external ADXL345 accelerometer and reading the values XYZ works just fine. I am now trying to detect a free fall, which seems a bit more complicated.
INT1 is connected to D30, but is never triggered. I assume my accel.interrupts call is wrong, but I cannot figure it out how to enable it correctly.
Anyone?
var i2c = new I2C(); i2c.setup({sda:D1, scl:D2});
var accel = require("ADXL345").connect(i2c,D31); accel.ff(300,25); accel.measure(true); accel.read();
accel.ff(600,10);
accel.interrupts(2,0); //INT1
setWatch(function() { console.log("Free Fall"); }, D30, {edge:"rising", debounce:10, repeat:true});
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.
I have connected puck to an external ADXL345 accelerometer and reading the values XYZ works just fine. I am now trying to detect a free fall, which seems a bit more complicated.
INT1 is connected to D30, but is never triggered. I assume my accel.interrupts call is wrong, but I cannot figure it out how to enable it correctly.
Anyone?