Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function updateDuty() {
b.analogWrite(MOTOR, speed, 60, scheduleNextUpdate);
//console.log("Duty Cycle: " +
// parseFloat(duty_cycle*100).toFixed(1) + " % " +
// "Position: " + position.toFixed(2));
}
function lightLEDs(number) {
// loop over the LEDs and turn on one for each record:
for (var pinNum=0; pinNum<4; pinNum++) {
var pin = 'USR' + pinNum; // set pin name, USR0 - USR3
if (pinNum < number) { // USR0=1 record, USR1=2 records...
io.digitalWrite(pin, 1); // turn on pin
} else {
io.digitalWrite(pin, 0); // turn off pin
}
}
}
function onReadBUTTON(x) {
buttonStatus = x.value;
$('#buttonStatus').html(buttonStatus);
b.digitalWrite(LED_BLUE, x.value ? b.LOW : b.HIGH);
setTimeout(readBUTTON, 100); // Read button again in 100ms
}
function onReadBUTTON(x) {
buttonStatus = x.value;
$('#buttonStatus').html(buttonStatus);
b.digitalWrite(LED_BLUE, x.value ? b.LOW : b.HIGH);
setTimeout(readBUTTON, 100); // Read button again in 100ms
}
function onReadBUTTON(x) {
buttonStatus = x.value;
$('#buttonStatus').html(buttonStatus);
b.digitalWrite(LED_BLUE, x.value ? b.LOW : b.HIGH);
setTimeout(readBUTTON, 100); // Read button again in 100ms
}
function blink() {
state = !state;
if(state) setTimeout(blink, 10); // Leave LED on for 10ms
if(!state) setTimeout(blink, 990); // Leave LED off for 990ms
b.digitalWrite(LED_RED, state ? b.HIGH : b.LOW);
}
function readPOT() {
// Fetch slider location using asynchronous callback
// function onAnalogRead()
b.analogRead(POT, onAnalogRead);
}
function readPOT() {
// Fetch slider location using asynchronous callback
// function onAnalogRead()
b.analogRead(POT, onAnalogRead);
}
var b = require('bonescript');
var pinos = [11, 12, 13, 14, 15, 16, 21, 22];
for (var i=0; i
function handleCancelTimer() {
console.log("cancel pin:" + pin);
bb.digitalWrite(pin, 0);
clearTimeout(cancelTimer);
}