Servo Motor Kutuphanesi(Library)
Dependents: RTOS_servo_motor step_servo_potile_motor thread_servo_led
Diff: servo.cpp
- Revision:
- 0:a693d4a007d6
diff -r 000000000000 -r a693d4a007d6 servo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servo.cpp Sun Dec 15 18:43:39 2019 +0000 @@ -0,0 +1,36 @@ +#include "servo.h" + +/* +Copyright (c) +Kutuphaneyi yazan(Author): Egitimci/Yazar - Mehmet Akif ARVAS + +Yazarin Kitaplari: + +Arm islemci Programlama - Seckin Yayincilik +Buy(Satın alma linki): https://www.seckin.com.tr/kitap/926844928 + +Arduino ile robotik programlama - Seckin Yayincilik +Buy(Satın alma linki): https://www.seckin.com.tr/kitap/469991743 + +twitter: @arvasmehmetakif +instagram: @arvasmehmetakif +*/ + +servo::servo(PinName pa) : sinyalpini(pa) {} + + +int servo::derece(int deger) { + + + int a=600+deger*9; + for(uint8_t x=0;x<20;x++) + { + sinyalpini=1; + wait_us(a); + sinyalpini=0; + wait_us(20000-a); + } + + return 0; + +} \ No newline at end of file