How to use bonescript - 10 common examples

To help you get started, we’ve selected a few bonescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jadonk / bone101 / examples / extras / mfba2014 / dcmotor.js View on Github external
function updateDuty() {
    b.analogWrite(MOTOR, speed, 60, scheduleNextUpdate);
    //console.log("Duty Cycle: " + 
    //    parseFloat(duty_cycle*100).toFixed(1) + " % " +
    //    "Position: " + position.toFixed(2));
}
github tigoe / BeginningNFC / NodeTagToLed / index.js View on Github external
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
      }
   }
}
github jadonk / bonescript / extras / bacon_cape / task9.html View on Github external
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
                }
github jadonk / bone101 / examples / extras / bacon_cape / task9.html View on Github external
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
                }
github jadonk / bone101 / examples / extras / bacon_cape / demo_jquery_with_7seg.html View on Github external
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
                }
github jadonk / bone101 / examples / extras / bacon_cape / hiw_demo.js View on Github external
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);
}
github jadonk / bone101 / examples / extras / bacon_cape / task8.html View on Github external
function readPOT() {
                    // Fetch slider location using asynchronous callback
                    // function onAnalogRead()
                    b.analogRead(POT, onAnalogRead);
                }
github jadonk / bone101 / examples / extras / escbrazil / task6.html View on Github external
function readPOT() {
                    // Fetch slider location using asynchronous callback
                    // function onAnalogRead()
                    b.analogRead(POT, onAnalogRead);
                }
github pingo-io / pingo-py / experiments / beagle / segmentos.js View on Github external
var b = require('bonescript');
var pinos = [11, 12, 13, 14, 15, 16, 21, 22];
for (var i=0; i
github simonmonk / prog_bbb / Prog BBB / 09_06_timer_server.js View on Github external
function handleCancelTimer() {
    console.log("cancel pin:" + pin);
    bb.digitalWrite(pin, 0);
    clearTimeout(cancelTimer);
}

bonescript

Physical computing library for embedded Linux

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis