งาน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);
}

ความคิดเห็น

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

(7)Arduino Line Follower Robot(อ้างอิงhttps://www.electronicshub.org/arduino-line-follower-robot/)

งานที่3:สรุปQuantum Computing

(20)Arduino Projects: Arduino Decibel Meter(อ้างอิงhttp://tutorial45.com/arduino-projects-arduino-decibel-meter/)