Avatar for Andrewmk

Andrewmk

Member since Dec 2016 • Last active Feb 2017
  • 2 conversations
  • 6 comments

Most recent activity

  • in Puck.js
    Avatar for Andrewmk

    @thedamos - have you seen this http://forum.espruino.com/conversations/­297639 ? It makes the LEDs dimmer but gives a lovely diffused glow. Also difficult to turn on and off though...

    Andrew

  • in News
    Avatar for Andrewmk

    This is great for whipping up a quick GUI on your phone to control something on the Puck. Here are two very simple examples that don't need any special code on the Puck to work.

    app.LoadPlugin( "PuckJS" );
    
    function OnStart()
    {
      lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
      btn1 = app.CreateToggle( "LED1" );
      btn2 = app.CreateToggle( "LED2" );
      btn3 = app.CreateToggle( "LED3" );
      btn1.SetOnTouch( btn1_OnTouch );
      btn2.SetOnTouch( btn2_OnTouch );
      btn3.SetOnTouch( btn3_OnTouch );
      lay.AddChild( btn1 );
      lay.AddChild( btn2 );
      lay.AddChild( btn3 );
      app.AddLayout( lay );
    
      puck = app.CreatePuckJS();
     // puck.Scan( "Puck" );
     puck.Connect('AA:BB:CC:DD:EE:FF');
    }
    
    function btn1_OnTouch( isChecked )
    {
      puck.SetLED( 1, isChecked );
    }
    function btn2_OnTouch( isChecked )
    {
      puck.SetLED( 2, isChecked );
    }
    function btn3_OnTouch( isChecked )
    {
      puck.SetLED( 3, isChecked );
    }
    
    app.LoadPlugin( "PuckJS" );
    var on= false;
    var intr;
    function OnStart()
    {
      lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
      btn1 = app.CreateToggle( "LED1" );
      btn1.SetOnTouch( btn1_OnTouch );
      lay.AddChild( btn1 );
      app.AddLayout( lay );
      puck = app.CreatePuckJS();
      puck.Connect('AA:BB:CC:DD:EE:FF');
    }
    
    function btn1_OnTouch( isChecked )
    {
      if (isChecked) {
       intr= setInterval('on=!on;puck.SetLED(1, on)', 500);
      }
     else {
        clearInterval(intr);
        puck.SetLED(1, false);
      }
    }
    

    Andrew

  • in Puck.js
    Avatar for Andrewmk

    The standard silicone cover is very nice but doesn't really diffuse the LEDs enough to mix the colours properly. If you carve a hole in a ping pong (table tennis) ball and pop it over the top instead you get a lovely diffused glow:

    https://www.youtube.com/watch?v=a59b0fkm­XQk

    Andrew

  • in News
    Avatar for Andrewmk

    That sounds like an excellent plan. Thanks for what you've done with the Pucks - they really are very nice little devices. Have a good break.

    Andrew

  • in Puck.js
    Avatar for Andrewmk

    Aha, I see you've added a pinout diagram and explanations to http://www.espruino.com/Puck.js. Thanks very much.

    I was thinking about using a string of WS2801 LEDs I have lying around.

    Andrew

  • in Puck.js
    Avatar for Andrewmk

    Hi. I've just received my Pucks and they are indeed lovely. I'd like to try controlling a string of RGB LEDs but need to know which pin to use for SPI. Is there a pinout diagram for the Puck similar to the ones for other boards (e.g. the one available here http://www.espruino.com/WiFi)? Thanks.

    Andrew

Actions