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" ); }
@Dave_Smart started
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.
Just use this code on DroidScript (make sure you install the Puck.js plugin on DroidScript first)