Pppd-140 — ~repack~

void lcd_init() delay_ms(50); // wait >40ms after VDD rises write_4bit(0x30); delay_ms(5); write_4bit(0x30); delay_us(150); write_4bit(0x30); write_4bit(0x20); // set to 4-bit mode // Now send 8-bit commands in two nibbles lcd_command(0x28); // 4-bit, 2 lines, 5x8 font lcd_command(0x0C); // display ON, cursor OFF lcd_command(0x06); // entry mode: increment, no shift lcd_command(0x01); // clear display delay_ms(2);

def send_nibble(bits, rs_val): GPIO.output(RS, rs_val) GPIO.output(DB4, (bits>>0) & 1) GPIO.output(DB5, (bits>>1) & 1) GPIO.output(DB6, (bits>>2) & 1) GPIO.output(DB7, (bits>>3) & 1) GPIO.output(E, 1); time.sleep(0.001); GPIO.output(E, 0) pppd-140

def send_byte(byte, is_data): send_nibble((byte>>4) & 0x0F, is_data) send_nibble(byte & 0x0F, is_data) time.sleep(0.002) # command execution time void lcd_init() delay_ms(50); // wait >40ms after VDD