You are reading a single comment by @user100558 and its replies. Click here to read the full conversation.
  • Hi Guys,

    I was having issues to connect with the espruino, but I was using the wrong code. So, I got how it works create my code, but now I'm receiving a return that my bluetooth is disconnected after connect. It is too weird. Do you know why?
    Follow below my code and the response in chrome

    Code:

    $scope.btnstatus = function(action) {
            var connection;
            if(action == 'on') {
                
                Puck.write('LED1.set();\n',function(call­back) {
                    console.log(callback);
                    Puck.write('Puck.getBatteryPercentage();­\n',function(baterry) {
                        console.log(callback);
                        initMap();
                    })
                });
            }
            else {
                Puck.write('LED1.reset();\n',function() {
                    Puck.write('Puck.magOff();\n',function()­ {
    
                    })
                });
            }
        };
    

    Response:

    Web Bluetooth is experimental on this platform. See https://github.com/WebBluetoothCG/web-bl­uetooth/blob/gh-pages/implementation-sta­tus.md
    puck.js:318 <BLE> Device Name:       Puck.js f0b5
    puck.js:318 <BLE> Device ID:         vtZGyU35qoD8K6UJmjRSEg==
    puck.js:318 <BLE> Connected
    puck.js:318 <BLE> Disconnected (gattserverdisconnected)
    
About

Avatar for user100558 @user100558 started