Avatar for Terrence

Terrence

Member since Feb 2017 • Last active Apr 2017
  • 3 conversations
  • 7 comments

Most recent activity

  • in Puck.js
    Avatar for Terrence

    Thank you Gordon, I will give those suggestions a try.

  • in Puck.js
    Avatar for Terrence

    Yes, that was the problem, I am now able to see the new Service.
    Thank you.

    My IOS nRF app does not allow me to change the data type, I only have a text box with 0x preceding it. Could you tell me is it asking for hex?
    I type in 1 and hit send and the box turns red, so it must not like it. The write types are Command and Request, both choke on me entering 1

  • in Puck.js
    Avatar for Terrence

    I am following along with the video:
    Puck.js Bluetooth with the Graphical Editor

    My puck shows up in the Nordic nRF Connect on my iPhone, but it only show the default UART Service, not the service I created and deployed by following the video.

    The IDE show this message:
    BLE connected, queueing BLE restart for later

    I disconnected and reconnected many times.

    version: 1v91

    Any Ideas?
    Thank you.

  • in Puck.js
    Avatar for Terrence

    Yes, it was a strong magnet and it was really close. Thanks for explaining the situation to me.

    • 3 comments
    • 148 views
  • in Puck.js
    Avatar for Terrence

    Thank you for the code sample, I will put it into place tonight.

  • in Puck.js
    Avatar for Terrence

    After about 10 seconds of mag readings (zero), I bring a magnet close to the puck. As expected the mag readings go up. Then I take the magnet away and the values go back down....a little. They do not go back down to the zero values that I would have expected.

    So the open close door example does not work correctly because we never get back below 1000.

    1v91 Copyright 2016 G.Williams
    41.49698784249
    { "x": -19, "y": 20, "z": 31 }
    41.49698784249
    108.59558002055
    { "x": -83, "y": 70, "z": -2 }
    113.89907813498
    { "x": -84, "y": 74, "z": -21 }
    115.32996141506
    { "x": -88, "y": 74, "z": -9 }
    112.82730166054
    { "x": -88, "y": 69, "z": 15 }
    112.29425630903
    { "x": -87, "y": 71, "z": 0 }
    117.02136557056
    { "x": -93, "y": 71, "z": -2 }
    8429.72300849796
    { "x": -5599, "y": -4602, "z": 4305 }
    8429.72300849796
    1419.88802375398
    { "x": -177, "y": -217, "z": 1392 }
    1341.72426377404
    { "x": -80, "y": -140, "z": 1332 }
    1317.90857042512
    { "x": -79, "y": -131, "z": 1309 }
    1302.96623133525
    { "x": -73, "y": -134, "z": 1294 }
    1320.38592843153
    { "x": -77, "y": -137, "z": 1311 }

    var zero = Puck.mag();
    var doorOpen = false;
    
    function onMag(p)
    {
      p.x -= zero.x;
      p.y -= zero.y;
      p.z -= zero.z;
      
      var magSqrt = Math.sqrt(p.x*p.x + p.y*p.y + p.z*p.z);
      console.log(magSqrt);
      console.log(p);
      
      var open = magSqrt < 1000;
      
      if (open!=doorOpen)
      {
        console.log(magSqrt);
        doorOpen = open;
        digitalPulse(open ? LED1 : LED2, 1,1000);
      }
      
    }
    
    Puck.on('mag', onMag);
    Puck.magOn();
    
    
  • in Puck.js
    Avatar for Terrence

    Is there a tutorial, that I can't find, that shows code to advertise the magnetometer values in a characteristic when the button is pushed?

    Thank you.

Actions