The LCD
class constructs an object that represents an LCD Display.
- 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
{
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
}
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");
});
});
Instead of writing out all the d pins from 1 to 7 you could maybe just say d1 - d7 in one row