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 /main.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 'main.c')
-rw-r--r-- | main.c | 56 |
1 files changed, 45 insertions, 11 deletions
@@ -40,14 +40,12 @@ #include "boards.h" #include "ble_sensorsim.h" #include "softdevice_handler.h" -#include "app_timer.h" #include "device_manager.h" #include "pstorage.h" #include "app_error.h" #include "app_trace.h" #include "app_timer.h" #include "app_gpiote.h" -#include "app_timer.h" #include "bsp.h" #include "phone_remote.h" @@ -121,6 +119,22 @@ static void hello_timer_handler(void* data) seconds++; printf("hello world, seconds=%" PRIu32 ", ticks=%" PRIu32 ", ms=%" PRIu32 "\r\n", seconds, ticks, ms); + +// liquid_crystal_clear(); + +// char buf0[8]; +// + liquid_crystal_set_cursor(0, 1); + uint32_t value = 1337; + app_timer_cnt_get(&value); + char buf1[9]; +// snprintf(buf1, sizeof(buf1), "%" PRIu32, value); + int size = snprintf(buf1, sizeof(buf1), "%" PRIu32, seconds); +// liquid_crystal_write_string("hello!"); + liquid_crystal_write_string_len(buf1, size); +// liquid_crystal_write_string(buf1); + buf1[8] = '\0'; + printf("buf: %s\r\n", buf1); } static void timers_init(void) @@ -410,18 +424,13 @@ int main(void) uint32_t err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS, APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), NULL); APP_ERROR_CHECK(err_code); - device_manager_init(); - gap_params_init(); - advertising_init(); - services_init(); - conn_params_init(); - - timers_start(); - liquid_crystal_init(false, true, false); liquid_crystal_reset(); + + /* liquid_crystal_display(true, false, false); liquid_crystal_write_string("01234567890123456"); + */ /* char chars[] = "abcdefghijklmopqrstuvwxyz"; @@ -431,14 +440,39 @@ int main(void) } nrf_delay_ms(1000); -*/ liquid_crystal_clear(); +*/ + + liquid_crystal_display(true, false, false); + nrf_delay_ms(500); + + liquid_crystal_display(false, false, false); + nrf_delay_ms(500); + + liquid_crystal_display(true, false, false); + nrf_delay_ms(500); + + liquid_crystal_display(false, false, false); + nrf_delay_ms(500); + + liquid_crystal_display(true, true, true); + nrf_delay_ms(500); // liquid_crystal_return_home(); liquid_crystal_set_cursor(1, 1); liquid_crystal_write_string("hello!"); + /* + device_manager_init(); + gap_params_init(); + advertising_init(); + services_init(); + conn_params_init(); + advertising_start(); + */ + + timers_start(); for (;; ) { |