2000₺ ÜZERİ ÜCRETSİZ KARGO! TÜRKİYE'NİN HER YERİNE HEPSİJET VE ARAS KARGO İLE YALNIZCA 150₺
2000₺ ÜZERİ ÜCRETSİZ KARGO! TÜRKİYE'NİN HER YERİNE HEPSİJET VE ARAS KARGO İLE YALNIZCA 150₺
2000₺ ÜZERİ ÜCRETSİZ KARGO! TÜRKİYE'NİN HER YERİNE HEPSİJET VE ARAS KARGO İLE YALNIZCA 150₺
Arduino ve Potansiyometre ile Servo Motor Kullanımı

Arduino ve Potansiyometre ile Servo Motor Kullanımı

İlk örnek için gerekli bileşenler:

DC Motor Kontrol Devre Şeması

DC Motor Kontrol Kaynak Kodu:

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);
}

Arduino ve Potansiyometre ile Servo Motor Kontrolü

Servo Motor Kontrol Devre Şeması

Kaynak Kodu:

#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);
}