![](/media/cache/group/mehmet_akif_arvas.jpg.50x50_q85.jpg)
thread ve servo motor kullanimi
Dependencies: mbed servo_motor mbed-rtos
main.cpp
- Committer:
- marvas
- Date:
- 2019-12-17
- Revision:
- 0:3221160b3d1f
File content as of revision 0:3221160b3d1f:
#include "mbed.h" #include "rtos.h" #include "servo.h" Thread servo_calismasi; DigitalOut led(PA_5); servo motor(PC_8); void motor_calismasi() { while(1) { motor.derece(5); wait(1); motor.derece(90); wait(1); motor.derece(120); wait(1); motor.derece(150); wait(1); motor.derece(175); wait(1); } } int main() { servo_calismasi.start(motor_calismasi);//thread başlatma ve fonkisyona yönlendirme while(true) { led=!led; wait(1); } return 0; }