diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 38 |
1 files changed, 28 insertions, 10 deletions
@@ -22,7 +22,7 @@ #include <string.h> #include "nordic_common.h" #include "nrf.h" -#include "app_error.h" +#include "nrf_delay.h" #include "nrf51_bitfields.h" #include "ble.h" #include "ble_hci.h" @@ -43,6 +43,7 @@ #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" @@ -293,7 +294,7 @@ static void on_ble_evt(ble_evt_t * p_ble_evt) if (p_ble_evt->evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT) { - printf("re-starting advertisement"); + printf("re-starting advertisement\n"); advertising_start(); /* err_code = bsp_indication_set(BSP_INDICATE_IDLE); @@ -399,7 +400,7 @@ int main(void) { app_trace_init(); - dbg("Soil Moisture device starting...\r\n"); + dbg("Phone remote starting...\r\n"); ble_stack_init(); timers_init(); @@ -409,16 +410,33 @@ 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(); + device_manager_init(); + gap_params_init(); + advertising_init(); + services_init(); + conn_params_init(); timers_start(); - liquid_crystal_init(APP_TIMER_TICKS(1, APP_TIMER_PRESCALER)); - liquid_crystal_write_string("hello world!"); + liquid_crystal_init(false, true, false); + liquid_crystal_reset(); + liquid_crystal_display(true, false, false); + liquid_crystal_write_string("01234567890123456"); +/* + char chars[] = "abcdefghijklmopqrstuvwxyz"; + + for(int i = 0; i < 10; i++) { + nrf_delay_ms(200); + liquid_crystal_write_char(chars[i]); + } + + nrf_delay_ms(1000); +*/ + liquid_crystal_clear(); +// liquid_crystal_return_home(); + + liquid_crystal_set_cursor(1, 1); + liquid_crystal_write_string("hello!"); advertising_start(); |