edson antonio vargas villarreal
/
LAB_STEPMOTOR
intentomotorpasoapaso
Fork of 00_LAB_STEPMOTOR by
Diff: main.cpp
- Revision:
- 1:5dfedc044f7a
- Parent:
- 0:2890f9a09e85
- Child:
- 2:1f5d8504b38d
diff -r 2890f9a09e85 -r 5dfedc044f7a main.cpp --- a/main.cpp Tue Mar 20 23:49:10 2018 +0000 +++ b/main.cpp Wed Mar 21 01:32:33 2018 +0000 @@ -5,7 +5,7 @@ Serial pc(USBTX,USBRX); int main() { uint32_t speed=1500; - uint8_t cw=1; + bool cw=true; while(1) { smotor1.set_speed(speed); @@ -15,7 +15,7 @@ smotor1.step(4096,cw); - cw=~cw &(0x01); + cw^=cw; speed=speed+200; if (speed > 10000)speed =1500; wait(1);