Projet ISIMA / Mbed 2 deprecated essai_stepper

Dependencies:   mbed

Committer:
thmaure
Date:
Thu May 21 14:21:25 2015 +0000
Revision:
0:a1d256e2cd41
moteur pas ? pas

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thmaure 0:a1d256e2cd41 1 #include "mbed.h"
thmaure 0:a1d256e2cd41 2
thmaure 0:a1d256e2cd41 3 DigitalOut enable(D2);
thmaure 0:a1d256e2cd41 4 PwmOut step(D3);
thmaure 0:a1d256e2cd41 5 PwmOut led(LED2);
thmaure 0:a1d256e2cd41 6 DigitalInOut mybut(USER_BUTTON);
thmaure 0:a1d256e2cd41 7
thmaure 0:a1d256e2cd41 8 int main() {
thmaure 0:a1d256e2cd41 9
thmaure 0:a1d256e2cd41 10 enable=1;
thmaure 0:a1d256e2cd41 11 step.period_ms(10);
thmaure 0:a1d256e2cd41 12 step.pulsewidth_ms(5);
thmaure 0:a1d256e2cd41 13 while(1){
thmaure 0:a1d256e2cd41 14
thmaure 0:a1d256e2cd41 15 enable=0;
thmaure 0:a1d256e2cd41 16 wait(0.1);
thmaure 0:a1d256e2cd41 17 enable=1;
thmaure 0:a1d256e2cd41 18 wait(0.4);
thmaure 0:a1d256e2cd41 19 }
thmaure 0:a1d256e2cd41 20 }