Avatar for hansamann

hansamann

Member since Jan 2014 • Last active Jan 2017
  • 21 conversations
  • 96 comments

Working on stuff that matters.

Most recent activity

    • 12 comments
    • 664 views
  • in Puck.js
    Avatar for hansamann

    I might be wrong of course, but I was expecting the ff function to convert my values. The docs on Espruino ADXL345 mention that the values are mg. It's also kind of working, it just happends the free fall event is only triggered once the device moves again.

  • in Puck.js
    Avatar for hansamann

    Hi @Gordon, I've not set "automatic sampling" - to be honest I've got no idea. Can you point me to some sample code somewhere?

  • in Puck.js
    Avatar for hansamann

    So, got the latest results for my free-fall trials. It's working, but it's a tiny bit strange. The behavior is like this:

    I let the puck with ADXL345 fall for like 1.5 meters or so
    IF I pick it up soon thereafter, I get the Free Fall event
    IF I let it be, pick it up after some seconds, nothing is triggered.

    To me it looks like the interrupts are only activated once new accelerometer data is received. Would that make somehow sense? Below is the latest code for reference.

    var i2c = new I2C();
    i2c.setup({sda:D1, scl:D2});
    
    var accel = require("ADXL345").connect(i2c,D31);
    accel.ff(600,10);
    accel.interrupts(4,0); //INT1
    accel.measure(true);
    
    setWatch(function() {
      console.log("Free Fall");
    }, D30, {edge:"rising", debounce:250, repeat:true});
    
    setWatch(function() {
      console.log("BTN");
    }, BTN, {edge:"rising", debounce:50, repeat:true});
    
    • 4 comments
    • 328 views
  • in Puck.js
    Avatar for hansamann

    Thx all, it looks like

    accel.interrupts(4,0) would enable free fall on INT1. Will try at home tonight.

  • in Puck.js
    Avatar for hansamann

    Thx for the thoughts, you're right that probably the accelerometer is the best choice of course. ADXL345 has free fall detection, I am currently investigating this. The problem is that the puck is such a nice package, even a lanyard can be attached. Now the extra cables for the accelerometer will require new 3d printing for another case, etc.

  • in Puck.js
    Avatar for hansamann

    Looks like the ADXL345 is nice and it has FF free fall detection. I am a bit troubled with activating it, but I am sure it will work in the end. thx a lot!

  • in Puck.js
    Avatar for hansamann

    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});
    
    
    
Actions