Skip to content

Instantly share code, notes, and snippets.

@divanvisagie
Forked from DylanKnevitt/LCD.md
Created December 9, 2014 18:22
Show Gist options
  • Save divanvisagie/6f8267367835c793afc8 to your computer and use it in GitHub Desktop.
Save divanvisagie/6f8267367835c793afc8 to your computer and use it in GitHub Desktop.

The LCD class constructs an object that represents an LCD Display.

Parameters

  • options An object of property parameters
Property Name Type Value(s) Description Required
pins Object ```js { rs, en, d4, d5, d6, d7 } ``` Sets the values of the rs, en, d4, d5, d6 and d7 pins. yes
  • pins
    Property Name Type Value(s) Description Required
    rs Number Any pin on board Sets the pin corresponding to the LCD Display's rs pin. yes
    en Number Any pin on board Sets the pin corresponding to the LCD Display's en pin. yes
    d0 Number Any pin on board Sets the pin corresponding to the LCD Display's d0 pin. yes
    d1 Number Any pin on board Sets the pin corresponding to the LCD Display's d1 pin. yes
    d2 Number Any pin on board Sets the pin corresponding to the LCD Display's d2 pin. yes
    d3 Number Any pin on board Sets the pin corresponding to the LCD Display's d3 pin. yes

Shape

{
  board: ...A reference to the board object the Led is attached to
  id: ...A user definable id value. Defaults to null
  pins : the object containing the pin values for rs, en, d0, d1, d2, d3
}

Usage

var five = require("johnny-five"), 
    board = new five.Board();

board.on("ready", function() {

  var lcd = new five.LCD({ pins: [ 2,3,4,5,11,12 ] });

  lcd.on("ready", function(){
    lcd.clear();
    lcd.home();
    lcd.print("Hello");
  });
  });

API

@divanvisagie
Copy link
Author

Instead of writing out all the d pins from 1 to 7 you could maybe just say d1 - d7 in one row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment