summaryrefslogtreecommitdiff
path: root/LiquidCrystal.c
diff options
context:
space:
mode:
Diffstat (limited to 'LiquidCrystal.c')
-rw-r--r--LiquidCrystal.c10
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);