งานที 4

int led = 10;
void setup()
{
  Serial.begin(9600);
  pinMode(led,OUTPUT);   
}
void loop()
{
  int x,y;
  x = analogRead(A0);
  y = map(x,0,1023,0,255);
  Serial.print("x = ");Serial.println(x);
  Serial.print("y = ");Serial.println(y); 
  analogWrite(led,y);

}

ความคิดเห็น

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

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

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

อธิบายโปรแกรมHow To Make Arduino Based Home Automation Project via Bluetooth