Created
October 28, 2019 11:12
-
-
Save RobolinkAkademi/0b98e8b281e214dade4c0e60314db86c to your computer and use it in GitHub Desktop.
Arduino projeleri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<Servo.h> | |
Servo sg90; | |
const byte potansiyometre = A5; | |
int pot_deger; | |
void setup() | |
{ | |
Serial.begin(9600); | |
sg90.attach(13); | |
} | |
void loop() | |
{ | |
pot_deger = analogRead(potansiyometre); | |
int servo_deger = map(pot_deger , 0, 1023, 0, 180); | |
sg90.write(servo_deger); | |
Serial.print("Servo = "); | |
Serial.print(servo_deger); | |
Serial.println(" Derece"); | |
delay(15); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment