返回列表 發帖

基礎數位輸出 (三)

  1. void setup()
  2. {
  3.   pinMode(10, OUTPUT);
  4.   pinMode(11, OUTPUT);
  5.   pinMode(12, OUTPUT);
  6.   pinMode(13, OUTPUT);
  7. }

  8. void loop()
  9. {
  10.   digitalWrite(10, HIGH);
  11.   delay(50);
  12.   digitalWrite(10, LOW);
  13.   delay(50);
  14.   digitalWrite(11, HIGH);
  15.   delay(50);
  16.   digitalWrite(11, LOW);
  17.   delay(50);
  18.   digitalWrite(12, HIGH);
  19.   delay(50);
  20.   digitalWrite(12, LOW);
  21.   delay(50);
  22.   digitalWrite(13, HIGH);
  23.   delay(50);
  24.   digitalWrite(13, LOW);
  25.   delay(50);
  26. }
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

  1. void setup()
  2. {
  3.   pinMode(12, OUTPUT);
  4.   pinMode(11, OUTPUT);
  5.   pinMode(10, OUTPUT);
  6.   pinMode(9, OUTPUT);

  7. }

  8. void loop()
  9. {
  10.   digitalWrite(12, HIGH);
  11.   delay(50);
  12.   digitalWrite(12, LOW);
  13.   delay(50);
  14.   digitalWrite(11, HIGH);
  15.   delay(50);
  16.   digitalWrite(11, LOW);
  17.   delay(50);
  18.   digitalWrite(10, HIGH);
  19.   delay(50);
  20.   digitalWrite(10, LOW);
  21.   delay(50);
  22.   digitalWrite(9, HIGH);
  23.   delay(50);
  24.   digitalWrite(9, LOW);
  25.   delay(50);

  26. }
複製代碼

TOP

void setup()
{
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(113, OUTPUT);
}

void loop()
{
  digitalWrite(10, HIGH);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(10, LOW);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(11, HIGH);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(11, LOW);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(12, HIGH);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(12, LOW);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(13, HIGH);
  delay(50); // Wait for 1000 millisecond(s)
  digitalWrite(13, LOW);
  delay(50); // Wait for 1000 millisecond(s)
}

TOP

  1. void setup()
  2. {
  3.   pinMode(10, OUTPUT);
  4.   pinMode(11, OUTPUT);
  5.   pinMode(12, OUTPUT);
  6.   pinMode(13, OUTPUT);
  7. }

  8. void loop()
  9. {
  10.   digitalWrite(10, HIGH);
  11.   delay(50);
  12.   digitalWrite(10, LOW);
  13.   delay(50);
  14.   digitalWrite(11, HIGH);
  15.   delay(50);
  16.   digitalWrite(11, LOW);
  17.   delay(50);
  18.   digitalWrite(12, HIGH);
  19.   delay(50);
  20.   digitalWrite(12, LOW);
  21.   delay(50);
  22.   digitalWrite(13, HIGH);
  23.   delay(50);
  24.   digitalWrite(13, LOW);
  25.   delay(50);
  26. }
複製代碼

TOP

返回列表