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:
- 1:c002cfb55315
- Parent:
- 0:a8339cee32b7
- Child:
- 2:ff609fd0c51a
--- a/motor.cpp Mon Aug 20 06:58:42 2018 +0000
+++ b/motor.cpp Mon Aug 20 07:37:12 2018 +0000
@@ -25,6 +25,7 @@
static Serial pc (USBTX , USBRX );
MOTOR_THROTTLE mt={0,};
+static UCHAR value=0;
//================================================================
//モーター制御モジュール初期化
@@ -60,15 +61,19 @@
//================================================================
//
//================================================================
-
-void motorUp(int val){
- int ch, v;
+
+void motorUp(){
+ int ch ,i , v;
+
+ for (i=0; i<10; i++){
+ if value != 0xFF {
+ value++;
+ }
for(ch=1; ch<3; ch++){
- for (v=val-10; v<val; v++){
- motorSpiSend(ch,v);
- wait(0.01);
- }
+ motorSpiSend(ch,value);
+ wait(0.01);
}
+ }
/*
for(ch=5; ch<9; ch++){
for(val=0; val<250; val +=5){