The distance is sent over UART0 every 50ms.
-Note tha for the tests the ultrasonic module is powered at 3.3V and that the right distance
+Note that for the tests the ultrasonic module is powered at 3.3V and that the right distance
is given by dividing the pulse width by 29 instead of 58 (value given on the ultrasonic
module wiki page).
const struct pio status_led_green = LPC_GPIO_1_4;
const struct pio status_led_red = LPC_GPIO_1_5;
-const struct pio sensor = LPC_GPIO_0_7; /* Ultrasonic sensor signal */
+const struct pio sensor = LPC_GPIO_0_6; /* Ultrasonic sensor signal */
/***************************************************************************** */
/* Callback on pulse start and end */
set_gpio_callback(pulse_feedback, &sensor, EDGES_BOTH);
+ uprintf(0, "Ultrasonic distance sensor using GPIO %d.%d\n", sensor.port, sensor.pin);
+
while (1) {
uint32_t distance = 0;