Program for controlling speed of motor

Dependencies:   mbed

Fork of DC_motor_1 by Dean Fraj

main.cpp

Committer:
dfraj
Date:
2017-12-18
Revision:
1:36da0aeaa51f
Parent:
0:1047df2357c5

File content as of revision 1:36da0aeaa51f:

#include "mbed.h"

PwmOut smjer1(p21);
PwmOut smjer2(p22);
PwmOut ledica(LED1);
AnalogIn pot(p20);
 
int main(){
    smjer1.period(0.001);
    smjer2 = 0;
    while(true){
        smjer1 = pot;    
        ledica = pot;    
    }
}