From 570bdb95dbfb7ee3af36396569d43575ed761650 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 31 May 2015 20:46:40 +0200 Subject: o Better LCD code, increased per command delay. --- LiquidCrystal.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'LiquidCrystal.c') diff --git a/LiquidCrystal.c b/LiquidCrystal.c index eed30c8..3411ea8 100644 --- a/LiquidCrystal.c +++ b/LiquidCrystal.c @@ -53,7 +53,9 @@ static void write_value(uint8_t value, bool is_data, uint32_t delay) { write_4(value >> 4); write_4(value); - nrf_delay_us(delay); + // something is going too fast. have to investigate. +// nrf_delay_us(delay); + nrf_delay_ms(delay); } void liquid_crystal_write_char(char chr) { @@ -66,6 +68,12 @@ void liquid_crystal_write_string(char *chr) { } } +void liquid_crystal_write_string_len(char *chr, size_t max_len) { + for (; *chr != '\0' && max_len > 0; chr++, max_len--) { + liquid_crystal_write_char(*chr); + } +} + void liquid_crystal_clear() { // The documentation doesn't specify a value, but everything else is 37us write_value(LIQUID_CRYSTAL_CMD_CLEAR, false, 50); -- cgit v1.2.3