Dean Fraj
/
DC_motor_1
Program for controlling speed of motor
Fork of DC_motor_1 by
Revision 1:36da0aeaa51f, committed 2017-12-18
- Comitter:
- dfraj
- Date:
- Mon Dec 18 10:52:02 2017 +0000
- Parent:
- 0:1047df2357c5
- Commit message:
- v2: added second PwmOut object
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1047df2357c5 -r 36da0aeaa51f main.cpp --- a/main.cpp Mon Dec 18 10:32:36 2017 +0000 +++ b/main.cpp Mon Dec 18 10:52:02 2017 +0000 @@ -1,13 +1,15 @@ #include "mbed.h" -PwmOut motor(p21); +PwmOut smjer1(p21); +PwmOut smjer2(p22); PwmOut ledica(LED1); AnalogIn pot(p20); int main(){ - motor.period(0.001); + smjer1.period(0.001); + smjer2 = 0; while(true){ - motor = pot; + smjer1 = pot; ledica = pot; } } \ No newline at end of file