Avatar for Ciaran

Ciaran

Member since Jul 2017 • Last active Sep 2017
  • 2 conversations
  • 4 comments

Most recent activity

    • 3 comments
    • 1,320 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Ciaran

    Awesome thanks. Will try.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Ciaran

    Hey,

    So I have a puckjs running off a webpage. When I use the light sensor and try to get temperature at the same time. The output of the temperature is the light reading instead of current temp. Works fine when run separately. Any ideas? Apologise for the JQuery. Just playing around with Puck for now!!! Thanks.

    $(".temperature").click(function() {
        Puck.eval("E.getTemperature()", function(y) {
            console.log(y);
            $('.currentTemp').text(y);
        })
        $(".main_content_wrap").addClass("rain")­;
        createRain();
    });
    
    connection.write("reset();\n", function() {
                // Wait for it to reset itself
    
                setTimeout(function() {
                    // Now tell it to write data on the current light level to Bluetooth
                    // 10 times a second
                    connection.write("setInterval(function()­{Bluetooth.println(Puck.light());},100);­\n",
                        function() { console.log("Ready..."); });
    
                }, 1500);
            });
    
    • 3 comments
    • 1,704 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Ciaran

    Awesome thanks for your reply. Will give it a go now.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Ciaran

    Hoping someone can help. Basically I want to call a function when I click on my PuckJs. Trying to use setWatch on my Puck.js. Works fine from the https://www.espruino.com/ide/

    But when I try and call the setWatch function from a webpage using bluetooth I get errors:
    Errors:

    setWatch is undefined

    Code is:

    setWatch(function() {
      console.log("Pressed");
    }, BTN, { edge: "rising", debounce: 50, repeat: true });
    

    Also if I load the code to the device through the webIDE, I cannot see the console.log message in chrome debug tool.s

Actions