![](/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
main.cpp
- Committer:
- marvas
- Date:
- 2019-12-21
- Revision:
- 1:d3dedfc5deda
- Parent:
- 0:dc00763ac8a7
File content as of revision 1:d3dedfc5deda:
#include "mbed.h" #include "rtos.h" #include "servo.h" servo motor(PB_4); DigitalOut kart_led(PA_5); DigitalOut led(PD_2); Thread calisma1,calisma2; void led_metodu() { while(true) { led=!led; 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); } }