C:\Users\LiTao\Desktop\儿童智能硬件资料\nrf51822\nRF51822EK_TM配套资料\EK_TM测试程序\跑马灯测试程序
1 int main(void) 2 { 3 uint8_t output_state = 0; 4 5 // Configure LED-pins as outputs 6 nrf_gpio_range_cfg_output(LED_START, LED_STOP);//[1] 7 8 while(true) 9 { 10 nrf_gpio_port_write(LED_PORT, 1 << (output_state + LED_OFFSET)); 11 output_state = (output_state + 1) & BLINKY_STATE_MASK; 12 nrf_delay_ms(100); 13 } 14 }
[1] This function can be used to configure pin range as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases).
链接:http://pan.baidu.com/s/1dDtZKgL
原文:http://www.cnblogs.com/happyhappy/p/4719605.html