d

Dependencies:   mbed

main.cpp

Committer:
hdzoisrael
Date:
2018-11-28
Revision:
1:c2ef1fd3dba8
Parent:
0:8709fd38c8ee

File content as of revision 1:c2ef1fd3dba8:

#include "mbed.h"
AnalogIn pot(A0);
PwmOut  motor(D6);  

int main() {
    motor.period_us(20000);
    while(1) {
        float ancho = pot*1000.0;
        float anchoservo= 2000.0 - ancho;
        //motor.write(ancho);
        motor.pulsewidth_us(anchoservo);
        
    }
}