d

Dependencies:   mbed

Committer:
hdzoisrael
Date:
Wed Nov 28 03:50:00 2018 +0000
Revision:
1:c2ef1fd3dba8
Parent:
0:8709fd38c8ee
n; ;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aldomarez 0:8709fd38c8ee 1 #include "mbed.h"
aldomarez 0:8709fd38c8ee 2 AnalogIn pot(A0);
aldomarez 0:8709fd38c8ee 3 PwmOut motor(D6);
aldomarez 0:8709fd38c8ee 4
aldomarez 0:8709fd38c8ee 5 int main() {
hdzoisrael 1:c2ef1fd3dba8 6 motor.period_us(20000);
aldomarez 0:8709fd38c8ee 7 while(1) {
aldomarez 0:8709fd38c8ee 8 float ancho = pot*1000.0;
aldomarez 0:8709fd38c8ee 9 float anchoservo= 2000.0 - ancho;
aldomarez 0:8709fd38c8ee 10 //motor.write(ancho);
aldomarez 0:8709fd38c8ee 11 motor.pulsewidth_us(anchoservo);
aldomarez 0:8709fd38c8ee 12
aldomarez 0:8709fd38c8ee 13 }
aldomarez 0:8709fd38c8ee 14 }
aldomarez 0:8709fd38c8ee 15