//push a nibble of data through the the LCD's DB4~7 pins, clocking with the Enable pin. //We don't care what RS and RW are, here. void LCD4Bit_mod::pushNibble(int value){ int val_nibble= value & 0x0F; //clean the value. (unnecessary) for (int i=DB[0]; i <= DB[3]; i++) { digitalWrite(i,val_nibble & 01); val_nibble >>= 1; } pulseEnablePin(); }
//push a nibble of data through the the LCD's DB4~7 pins, clocking with the Enable pin. static void pushNibble(int value){ int val_nibble= value & 0x0F; //clean the value. (unnecessary) digitalWrite(DB0_PORT, DB0_BIT,val_nibble & 1); digitalWrite(DB1_PORT, DB1_BIT,val_nibble>>1 & 1); digitalWrite(DB2_PORT, DB2_BIT,val_nibble>>2 & 1); digitalWrite(DB3_PORT, DB3_BIT,val_nibble>>3 & 1); pulseEnablePin(); }
//push a byte of data through the LCD's DB4~7 pins, in two steps, clocking each with the enable pin. void LCD4Bit_mod::pushByte(uint8_t value){ wrtbits(DATA_PORT, DATA_PINS_HI_NIBBLE(value), DATA_PINS); pulseEnablePin(); wrtbits(DATA_PORT, DATA_PINS_LO_NIBBLE(value), DATA_PINS); pulseEnablePin(); }
//push a nibble of data through the the LCD's DB4~7 pins, clocking with the Enable pin. //We don't care what RS and RW are, here. void pushNibble(uint8_t value) { output_nibble(LCD_INTERFACE_PORT, value); pulseEnablePin(); }