How to use the johnny-five.LCD function in johnny-five

To help you get started, we’ve selected a few johnny-five 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 tdd / node-demo / app / arduino.js View on Github external
board.on('ready', function() {
  console.log('Arduino board ready'.debug);

  // We're assuming a standard 2x16 LCD display that we're going to use in
  // the usual 4-bit mode.
  lcd = new five.LCD({
    //     RS  EN  DB4 DB5 DB6 DB7
    pins: [5,  6,  7,  8,  9,  10]
  });
  lcd.on('ready', function() {
    lcd.clear().print('Welcome Mix-IT');
  });

  green  = new five.Led({ pin: 11 }).off();
  yellow = new five.Led({ pin: 12 }).off();
  red    = new five.Led({ pin: 13 }).off();

  bindToEngine();
});
github Azure / connectthedots / Devices / DirectlyConnectedDevices / NodeJS / IntelEdisonGrove / inteledisonctd.js View on Github external
var connect_the_dots = function()
{
    console.log("Device Ready to connect its dots");
    
    // Initialize LCD
    var lcd = new five.LCD({
        controller: "JHD1313M1"
    });
    lcd.bgColor(0xFF, 0xFF, 0xFF).cursor(0,0).print('ConnectTheDots');
    lcd.bgColor(0xFF, 0xFF, 0xFF).cursor(1,0).print('Azure IoT');

    // Initialize temperature sensor
    var data_temperature = {"measurename":"Temperature", "unitofmeasure":"C", "value":0};
    var data_humidity = {"measurename":"Humidity", "unitofmeasure":"%", "value":0};   
    var temperature_humidity = new TH02(6);
    
    setInterval(function(){
        data_temperature.value = temperature_humidity.getCelsiusTemp();
        data_humidity.value = temperature_humidity.getHumidity();
        
        // Jut for the fun of it, let's color the LCD background based on temperature
        var r = linear(0x00, 0xFF, data_temperature.value, 40);
github intel / intel-iot-services-orchestration-layer / node_modules / hope-demo / lattepanda / init.js View on Github external
address   = params[1],
    string    = params[2];
  } else if (params.length == 2){
    address   = "0x20";
    string    = params[1];
  }
  
  log("address: " + address);
  log("string: " + string);
  
  string = decodeURI(string);
  
  if (!lcds[address]) {
    log("creating lcd at address: " + address);
    lcds[address] = {
      obj: new five.LCD({ 
          controller: "PCF8574", // works for DF lcd
          address   : 0x20 + (Number(address - "0x20") || 0)
          }),
      msg: ""
    };
  }
  
  var lcd = lcds[address].obj;
  var msg = lcds[address].msg;
  
  if (msg != string){
    lcd.clear();
    lcd.blink();
    lcds[address].msg = string;
  
    lcd.print(string);
github mimming / firebase-rpi-arduino / bitcoin-price-lcd.js View on Github external
board.on("ready", function() {
  // Init the LCD
  var lcd = new five.LCD({
    // LCD pins  RS  EN  DB4  DB5  DB6  DB7
    pins:       [ 7,  8,   9,  10,  11,  12 ],
    rows: 2, cols: 16
  });

  // Set up Firebase to reference the cryptocurrency open data set
  var myFirebaseRef = new Firebase("https://publicdata-cryptocurrency.firebaseio.com/bitcoin");
  lcd.on("ready", function() {
    // Listen for changes to the Bitcoin price
    myFirebaseRef.child("last").on("value", function(snap) {
      // Print the value on the LCD
      lcd.cursor(1, 1).clear().print("BTC: " + snap.val());
    });
  });
});
github mimming / firebase-rpi-arduino / potentiometer-lcd.js View on Github external
// the Repl instance's context;
  // allows direct command line access
  board.repl.inject({
    pot: potentiometer
  });

  var lastKnownVal = 0;
  // "data" get the current reading from the potentiometer
  potentiometer.on("data", function() {
    if(this.value != lastKnownVal) {
      lastKnownVal = this.value;
      myFirebaseRef.set(this.value);
    }
  });

  var lcd = new five.LCD({
    // LCD pin name  RS  EN  DB4 DB5 DB6 DB7
    // Arduino pin # 7    8   9   10  11  12
    pins: [ 7, 8, 9, 10, 11, 12 ],
    rows: 2,
    cols: 16
  });

  lcd.on("ready", function() {
    myFirebaseRef.on("value", function(snap) {
      lcd.clear().print(snap.val());
      lcd.cursor(1, 0);
    });
  });
});
github rwaldron / johnny-five / eg / arduino-starter-kit / crystal-ball.js View on Github external
board.on("ready", function() {
  var button = new five.Button(6);
  var lcd = new five.LCD({
    pins: [12, 11, 5, 4, 3, 2],
  });
  var crystalBall = new CrystalBall(lcd);
  crystalBall.ask();
  button.on("press", function() {
    crystalBall.reply();
  });
});
github stevekinney / nodebots-workshop / example-code / 07-lcd / 01-basic-lcd.js View on Github external
board.on('ready', () => {
  var lcd = new five.LCD({
    pins: ['a2', 'a3', 'a4', 'a5', 'a6', 'a7'],
  });

  lcd.cursor(0, 0).print('Hello');
  lcd.cursor(1, 0).print('World');
});
github w4ilun / edison-guides / recipies / Johnny-Five Examples / lcd-screen.js View on Github external
board.on("ready", function() {
  var lcd = new five.LCD({
    controller: "JHD1313M1"
  });

  lcd.useChar("heart");
  lcd.cursor(0, 0).print("I :heart: Johnny-Five");
});

johnny-five

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis