diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-05-31 20:46:40 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-05-31 20:46:40 +0200 |
commit | 570bdb95dbfb7ee3af36396569d43575ed761650 (patch) | |
tree | 30a0bce8a7041ed38d2e2a9175446e2573562390 /LiquidCrystal.c | |
parent | 8f45739d02f02c226452f7f62c4dc195e6e13b38 (diff) | |
download | phone_remote_nrf51-570bdb95dbfb7ee3af36396569d43575ed761650.tar.gz phone_remote_nrf51-570bdb95dbfb7ee3af36396569d43575ed761650.tar.bz2 phone_remote_nrf51-570bdb95dbfb7ee3af36396569d43575ed761650.tar.xz phone_remote_nrf51-570bdb95dbfb7ee3af36396569d43575ed761650.zip |
o Better LCD code, increased per command delay.
Diffstat (limited to 'LiquidCrystal.c')
-rw-r--r-- | LiquidCrystal.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |