controle de motor de passo com meio passo

Dependencies:   mbed

Committer:
rebecams
Date:
Tue Apr 23 12:09:22 2019 +0000
Revision:
0:fc2517fdd508
meio passo motor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rebecams 0:fc2517fdd508 1 #include "mbed.h"
rebecams 0:fc2517fdd508 2
rebecams 0:fc2517fdd508 3 PwmOut mypwm(PWM_OUT);
rebecams 0:fc2517fdd508 4
rebecams 0:fc2517fdd508 5 DigitalOut myled(LED1);
rebecams 0:fc2517fdd508 6
rebecams 0:fc2517fdd508 7 int main() {
rebecams 0:fc2517fdd508 8
rebecams 0:fc2517fdd508 9 mypwm.period_ms(10);
rebecams 0:fc2517fdd508 10 mypwm.pulsewidth_ms(1);
rebecams 0:fc2517fdd508 11
rebecams 0:fc2517fdd508 12 printf("pwm set to %.2f %%\n", mypwm.read() * 100);
rebecams 0:fc2517fdd508 13
rebecams 0:fc2517fdd508 14 while(1) {
rebecams 0:fc2517fdd508 15 myled = !myled;
rebecams 0:fc2517fdd508 16 wait(1);
rebecams 0:fc2517fdd508 17 }
rebecams 0:fc2517fdd508 18 }