austinbv / dino

Dino is a ruby gem that helps you bootstrap prototyping with an Arduino
MIT License
389 stars 84 forks source link

Add LCD support #40

Closed supherman closed 11 years ago

vickash commented 11 years ago

Can you change after_initialize to accept the pins as a hash? For example:

lcd = Dino::Components::LCD.new(
          board: board,
          pins: {rs: 12, enable: 11, d4: 5, d5: 4, d6: 3, d7: 2}
      )

You can order them properly inside the class before sending to the board. This is more consistent with the parameters for all the other components. And if you're working with a bare LCD, this is much easier to understand. You don't need to look up the order of parameters for the Arduino LiquidCrystal constructor.

You may also want to add the ability to initialize the LCD in 8-bit mode, since the LiquidCrystal library already supports it. See http://arduino.cc/en/Reference/LiquidCrystalConstructor. Ignoring the rw pin in both 4-bit and 8-bit cases is probably ok.