nRF51 Example 6 - Timer

Source Demo

time1

My Demo

Add 2 LED
time2

Please click “more” on the right!

Part of my source files

main.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int main(void)
{
//
LED_Init();
while (1)
{
LED_Toggle(LED_1);
//使用定时器0产生1s定时
nrf_timer_delay_ms(TIMER0, TIMER_DELAY_MS);
LED_Toggle(LED_2);
// 使用定时器1产生1s定时
nrf_timer_delay_ms(TIMER1, TIMER_DELAY_MS);
LED_Toggle(LED_3);
// 使用定时器2产生1s定时
nrf_timer_delay_ms(TIMER2, TIMER_DELAY_MS);
}
}

Download my files


This work is licensed under a Creative Commons Attribution 4.0 International License.