Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: motor.cpp
- Revision:
- 2:ff609fd0c51a
- Parent:
- 1:c002cfb55315
- Child:
- 3:6898c5bd7fef
diff -r c002cfb55315 -r ff609fd0c51a motor.cpp
--- a/motor.cpp Mon Aug 20 07:37:12 2018 +0000
+++ b/motor.cpp Mon Aug 20 07:58:27 2018 +0000
@@ -63,10 +63,10 @@
//================================================================
void motorUp(){
- int ch ,i , v;
+ int ch ,i;
for (i=0; i<10; i++){
- if value != 0xFF {
+ if (value != 0xFF) {
value++;
}
for(ch=1; ch<3; ch++){
@@ -84,7 +84,7 @@
*/
}
-void motorStop(int val){
+void motorStop(){
int ch, v;
/*
for(ch=5; ch<9; ch++){
@@ -94,11 +94,12 @@
}
*/
for(ch=1; ch<3; ch++){
- for (v=val; v>0; v--){
+ for (v=value; v>0; v--){
motorSpiSend(ch,v);
wait(0.01);
}
}
+ value = 0;
}