งานที่5



int led = 13;
int sw = 2;
void setup()
{
  Serial.begin(9600);
  pinMode(led,OUTPUT);
  pinMode(sw,INPUT);       
}

void loop()

  int x;
  x = digitalRead(sw);
  Serial.print("x = ");Serial.println(x);
  digitalWrite(led,!x);  
}

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

https://www.arduitronics.com/article/22/arduino-and-motor-control-part-1

https://www.9arduino.com/article/71/โปรเจคเครื่องรดน้ำต้นไม้อัตโนมัติ-ด้วย-arduino-ราคาถูก-พร้อม-code-ตัวอย่าง

https://medium.com/sathittham/arduino-lcd-16x2-hello-world-dca09fd904f8