• Hi,
    My puck.js not advertising anymore, i have changed the battery then the green led flash 5 times sometimes when i click the button.
    In a few weeks, The old battery has suddenly lost all its power from ~90% to ~20%.

    When the battery has died, i changed it with a the same new then impossible to scan it and these flashes started..

    What's the meaning of green led flashing ?

    Thanks!

    here the script uploaded :

    `reset();
    	echo(0);
    	notify(0);
    	clearInterval();
    	clearWatch();
    	var presses=0;
    	var timeoutDoubleClick = null;
    	var nbClick = 0;
    	var activeDebug = "";
    	var releasedTime = 0;
    	var timeoutReleased = null;
    	var switchMode = null;
    	var low = 0;
    	var state = {press : false, release : false};
    	var batteryLevel = 0;
    	
    	setWatch(function() {
    		state.release = true;
    		state.press = false;
    		
    		if(releasedTime){
    			activeDebug = "d";
    			LED.set();	
    		}else{
    			activeDebug = "";
    		}
    		nbClick++;
    		if (!timeoutDoubleClick) {
    			timeoutDoubleClick = setTimeout(function(){	
    				timeoutDoubleClick = null;
    				NRF.setAdvertising({},{
    					interval:150,
    					manufacturer:0x0590,
    					manufacturerData:activeDebug+"clk-"+pres­ses+"-"+nbClick+"-${scriptVersion}-"+bat­teryLevel
    
    				});
    				nbClick = 0;
    			}, 500);
    		}
    		if (nbClick > 1) {
    			clearTimeout(timeoutDoubleClick);
    			timeoutDoubleClick = null;
    
    			NRF.setAdvertising({},{
    				interval:150,
    				manufacturer:0x0590,
    				manufacturerData:activeDebug+"clk-"+pres­ses+"-"+nbClick+"-${scriptVersion}-"+bat­teryLevel
    			});
    			nbClick = 0;
    		}
    		if(presses > 98){
    			presses=0;
    		}
    		presses++;
    		
    	  }, BTN, {edge:"falling", debounce:20, repeat:1});
    	setWatch(function(){
    		state.release = false;
    		state.press = true;
    		if(timeoutReleased){clearTimeout(timeout­Released);}
    		timeoutReleased =  setTimeout(function(){
    			timeoutReleased = null;
    			if(!state.release){
    				releasedTime = !releasedTime;
    				var flicker = 0;
    				switchMode = setInterval(function(){
    					LED.set();
    					flicker++;
    					setTimeout(function(){
    						LED.reset();
    					},150);
    					if(flicker == 3){clearInterval(switchMode);}
    				},300);
    			}
    		},10000)
    		LED.set();
    		if(!activeDebug){
    			LED2.reset();
    			LED3.reset();
    		}
    		LED.reset();
    	}, BTN, {
    		edge:'rising',
    		repeat:1,
    		debounce:20
    	});
    	LED1.set();
    	function sendBatteryInfo(){
    			batteryLevel = Math.round(E.getBattery());
    			if(batteryLevel < 20){ low = 1;}
    	}
    	sendBatteryInfo();
    	setInterval(sendBatteryInfo,60 * 60 * 1000);
    	save();\n`
    
About

Avatar for Christof550 @Christof550 started