How to use the bonescript.digitalWrite function in bonescript

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 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 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);
}
github MarkAYoder / BeagleBoard-exercises / iot / phant / flashUp.js View on Github external
function allOff() {
    console.log("allOff");
    b.digitalWrite(red,   0);
    b.digitalWrite(green, 0);
    b.digitalWrite(blue,  0);
}
github MarkAYoder / BeagleBoard-exercises / displays / blue / blinkOneLED.js View on Github external
function toggle() {
    if(state == 0) {
        state = 1;
    } else {
        state = 0;
    }
    b.digitalWrite(led, state);
}
github MarkAYoder / BeagleBoard-exercises / displays / blue / blinkLEDs.js View on Github external
function toggle() {
    if(state == 0) state = 1;
    else state = 0;
    for(var i in leds) {
        b.digitalWrite(leds[i], state);
    }
}
github jadonk / bone101 / examples / BeagleBone / input.js View on Github external
function toggle() {
    state = (state == b.LOW) ? b.HIGH : b.LOW;
    b.digitalWrite(outputPin, state);
    setTimeout(toggle, mydelay);
}

bonescript

Physical computing library for embedded Linux

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis