Send Data on Puck button click to android device.

Posted on
  • Hi, I want to send text "Hello World" when user click Puck button and want to display "Hello World" message on my android phone screen.

  • To do that, you could potentially use Eddystone: http://www.espruino.com/Puck.js+Eddystone

    Or if not, you would need to make an app for your phone. If you haven't done anything like that before then you could look at DroidScript - it might be a good way to get started

  • Hi Gordon,

    I have gone through the links.

    1. Regarding espruino.com/Puck.js+Eddyston­e it seems that we need to
      install another app to achieve this and I don't want to install new app.
    2. DroidScript seems good option but I don’t know how to send data on
      Puck button click and receive that data at app side. Any link or
      guide for achieving this.

    Thanks

  • You don't need an app to get eddystone working - any Android device from the last few years with Chrome on it should work (it's possible you have to change one setting in Android, but i'm not sure)

  • There is a free plugin for DroidScript and Puck.js

  • If we can print from Puck button on espruino ide screen then definitely there will be some way to print on android app screen

  • Just use this code on DroidScript (make sure you install the Puck.js plugin on DroidScript first)

    app.LoadPlugin( "PuckJS" );
    
    function OnStart()
    {
      lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
      txt = app.CreateText( "Press your puck" );
      lay.AddChild( txt );
      app.AddLayout( lay );
      puck = app.CreatePuckJS();
      puck.SetOnConnect( OnConnect );
      puck.SetOnButton( OnButton );
      puck.Scan( "Puck" );
    }
    function OnConnect()
    {
      puck.WatchButton( true );
    }
    function OnButton( state )
    {
      txt.SetText( "Hello World" );
    }
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Send Data on Puck button click to android device.

Posted by Avatar for user71304 @user71304

Actions