![](/media/cache/group/mehmet_akif_arvas.jpg.50x50_q85.jpg)
thread ile servo motor, harici led ve kart ledi calistirma
Dependencies: mbed servo_motor mbed-rtos
Revision 1:d3dedfc5deda, committed 2019-12-21
- Comitter:
- marvas
- Date:
- Sat Dec 21 07:15:37 2019 +0000
- Parent:
- 0:dc00763ac8a7
- Commit message:
- thread ile servo motor, harici led ve kart ledi calistirma
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
servo_motor.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r dc00763ac8a7 -r d3dedfc5deda main.cpp --- a/main.cpp Sat Dec 21 06:50:03 2019 +0000 +++ b/main.cpp Sat Dec 21 07:15:37 2019 +0000 @@ -1,10 +1,13 @@ #include "mbed.h" #include "rtos.h" +#include "servo.h" + +servo motor(PB_4); DigitalOut kart_led(PA_5); DigitalOut led(PD_2); -Thread calisma1; +Thread calisma1,calisma2; void led_metodu() { @@ -13,9 +16,25 @@ wait_ms(100); } } + +void servo_metodu() +{ + while(true) + { + motor.derece(5); + wait(1); + motor.derece(20); + wait(0.5f); + motor.derece(92); + wait(1); + motor.derece(175); + wait(1); + } + } int main() { calisma1.start(led_metodu); + calisma2.start(servo_metodu); while(true) { kart_led=!kart_led; wait(2);
diff -r dc00763ac8a7 -r d3dedfc5deda servo_motor.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servo_motor.lib Sat Dec 21 07:15:37 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/marvas/code/servo_motor/#a693d4a007d6