Linkit ONE开发板实验01-闪灯程序

来源:互联网 发布:淘宝售后入口多久关闭 编辑:程序博客网 时间:2024/05/22 06:07
一般情况下拿到一个开发板要干的第一件事情就是通过操作板载的LED灯来验证开发环境是否OK。
程序代码如下所示:

#define LED_GPIO_PIN  13// the setup function runs once when you press reset or power the boardvoid setup() { // initialize digital pin 13 as an output.   pinMode(LED_GPIO_PIN, OUTPUT);}void ledOn() {  digitalWrite(LED_GPIO_PIN, HIGH);   // turn the LED on (HIGH is the voltage level)}void ledOff() {  digitalWrite(LED_GPIO_PIN, LOW);    // turn the LED off by making the voltage LOW}// the loop function runs over and over again forevervoid loop() {    ledOn();  delay(1000);              // wait for a second  ledOff();  delay(1000);              // wait for a second}


最后就是把程序下载到板子上测试了。

原创粉丝点击