彰化一整天的論壇

 找回密碼
 立即註冊
查看: 575|回復: 0

主機版燈閃爍

[複製鏈接]
發表於 2016-10-6 19:11:27 | 顯示全部樓層 |閱讀模式
  1. /*
  2.   Blink
  3.   Turns on an LED on for one second, then off for one second, repeatedly.

  4.   Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  5.   it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN takes care
  6.   of use the correct LED pin whatever is the board used.
  7.   If you want to know what pin the on-board LED is connected to on your Arduino model, check
  8.   the Technical Specs of your board  at https://www.arduino.cc/en/Main/Products
  9.   
  10.   This example code is in the public domain.

  11.   modified 8 May 2014
  12.   by Scott Fitzgerald
  13.   
  14.   modified 2 Sep 2016
  15.   by Arturo Guadalupi
  16. */


  17. // the setup function runs once when you press reset or power the board
  18. void setup() {
  19.   // initialize digital pin LED_BUILTIN as an output.
  20.   pinMode(LED_BUILTIN, OUTPUT);
  21. }

  22. // the loop function runs over and over again forever
  23. void loop() {
  24.   digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  25.   delay(1000);                       // wait for a second
  26.   digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  27.   delay(1000);                       // wait for a second
  28. }
複製代碼


回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|手機版|小黑屋|彰化一整天的論壇(Excel,Office)  

GMT+8, 2019-12-12 22:24 , Processed in 0.154249 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表