int pwmPin = 7; void setup() { Serial.begin(9600); pinMode( pwmPin, OUTPUT); } void loop () { int potValue = analogRead(A0); int newpotValue = map(potValue, 0, 1023, 0 , 255); analogWrite(pwmPin, newpotValue); }
#include <Servo.h> Servo myServo; void setup() { myServo.attach(7); } void loop() { int potValue = analogRead(A0); int angleValue = map(potValue, 0, 1023, 0, 180); myServo.write(angleValue); delay(10); }
Alışveriş deneyiminizi iyileştirmek için yasal düzenlemelere uygun çerezler (cookies) kullanıyoruz. Detaylı bilgiye Gizlilik ve Çerez Politikasısayfamızdan erişebilirsiniz.