From d80b85b2a6bf313c0ca94c5f8bd4a0ebb1c3c4b9 Mon Sep 17 00:00:00 2001 From: Trifun Savic Date: Wed, 15 Jun 2022 15:12:09 +0200 Subject: [PATCH] #32 Adding comments if this project needs to be used with DotBot board. This project calls the US driver, initializes US and starts the ranging implemented using PPI. The value of the ECHO pin from the US sensor is passed to a callback us_callback in the us_reading parameter. --- projects/01bsp_us_ranging/01bsp_us_ranging.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/01bsp_us_ranging/01bsp_us_ranging.c b/projects/01bsp_us_ranging/01bsp_us_ranging.c index ae549b96a..8e1dd965a 100644 --- a/projects/01bsp_us_ranging/01bsp_us_ranging.c +++ b/projects/01bsp_us_ranging/01bsp_us_ranging.c @@ -1,7 +1,9 @@ /** * @file 01bsp_us_ranging.c * @author Trifun Savic + * * @brief This is a short example of how to do Ultrasound ranging with HC-SR04 sensor on the DotBot board. + * This code currently works on nRF52840. To use the code on DotBot you need to define different GPIO for US sensor ON and READ pin (trigger and echo) in hc_sr04.c * * @copyright Inria, 2022 * @@ -38,6 +40,9 @@ int main(void) { timer0 = NRF_TIMER0; timer1 = NRF_TIMER1; + // uncomment if using this code on DotBot Turn ON the DotBot board regulator + //db_board_init(); + // initilize the US sensor, set callback and chose the timers us_init(&us_callback, &timer_callback, timer0, timer1);