Program for controlling speed of motor

Dependencies:   mbed

Fork of DC_motor_1 by Dean Fraj

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 PwmOut smjer1(p21);
00004 PwmOut smjer2(p22);
00005 PwmOut ledica(LED1);
00006 AnalogIn pot(p20);
00007  
00008 int main(){
00009     smjer1.period(0.001);
00010     smjer2 = 0;
00011     while(true){
00012         smjer1 = pot;    
00013         ledica = pot;    
00014     }
00015 }