Skip to content

Commit c5dcad6

Browse files
committed
Blink when receive uart data too.
1 parent e273e72 commit c5dcad6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

soft/main.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ int main(void)
2626

2727
// initialize I2C:
2828
if (!twi_master_init())
29-
for(;; nrf_gpio_pin_toggle(LED), nrf_delay_ms(50)); // quick blink if error
29+
for(;; nrf_gpio_pin_toggle(LED), nrf_delay_ms(200)); // quick blink if error
3030

3131
// initialize IMU:
3232
nrf_delay_ms(4); // time needed to power up the IMU
3333
if (!mpu6050_init(DEVADR))
34-
for(;; nrf_gpio_pin_toggle(LED), nrf_delay_ms(150)); // less quick blink if error
34+
for(;; nrf_gpio_pin_toggle(LED), nrf_delay_ms(600)); // less quick blink if error
3535

3636
while(true) {
3737
const uint8_t to = 10; // ms
@@ -41,6 +41,11 @@ int main(void)
4141
simple_uart_putstring((const uint8_t *)"Received: ");
4242
simple_uart_put(cr);
4343
simple_uart_putstring((const uint8_t *)"\r\n");
44+
45+
for (int i=0; i<6; i++) {
46+
nrf_gpio_pin_toggle(LED);
47+
nrf_delay_ms(30);
48+
}
4449
}
4550
}
4651

@@ -49,7 +54,7 @@ int main(void)
4954

5055
for (int i=0; i<4; i++) {
5156
nrf_gpio_pin_toggle(LED);
52-
nrf_delay_ms(100);
57+
nrf_delay_ms(90);
5358
}
5459
}
5560
}

0 commit comments

Comments
 (0)