diff options
| author | Abel Tim <abel@main.home> | 2024-06-30 20:12:34 +0200 |
|---|---|---|
| committer | Abel Tim <abel@main.home> | 2024-06-30 20:12:34 +0200 |
| commit | 59db64a6e61d8c863f76a4cf8f366b65184192dd (patch) | |
| tree | e6edabcaf09004a71d55656a1ab281018307692b /debug/motordriver/nomultiplexer | |
| parent | b3c098fbb5bc0f64feda8d20e0dafb91f00aa20a (diff) | |
| download | robotica-59db64a6e61d8c863f76a4cf8f366b65184192dd.tar.gz robotica-59db64a6e61d8c863f76a4cf8f366b65184192dd.zip | |
to fix: change mcp2.analogWrite(m1pwm1, spdA); to us softPWM
Diffstat (limited to 'debug/motordriver/nomultiplexer')
| -rw-r--r-- | debug/motordriver/nomultiplexer/nomultiplexer.ino | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/debug/motordriver/nomultiplexer/nomultiplexer.ino b/debug/motordriver/nomultiplexer/nomultiplexer.ino index 4ca1ca8..abfe14c 100644 --- a/debug/motordriver/nomultiplexer/nomultiplexer.ino +++ b/debug/motordriver/nomultiplexer/nomultiplexer.ino @@ -190,9 +190,8 @@ void moveohmi(int speed, int direction){ double x = cos(dirrad); Serial.println((String)"x:"+x+" y:"+y); double spdeA = y*speed; - double spdeB = (-0.500*x - sqrt(3.000)/2.000*y)*speed; - double spdeC = (-0.500*x + sqrt(3.000)/2.000*y)*speed; - Serial.println(spdeA); + double spdeB = (-0.500*x - 0.8660054*y)*speed; + double spdeC = (-0.500*x + 0.8660054*y)*speed; Amove(spdeA); Bmove(spdeB); Cmove(spdeC); @@ -203,7 +202,6 @@ void rotate(int rodeg, int speed){ //use compas heading } void demo(){ - Amove(sp); Bmove(sp); Cmove(sp); @@ -235,8 +233,8 @@ void demo(){ moveohmi(sp, 35); Serial.println("ohmi move 35deg"); delay(1000); - - moveohmi(sp, 215); + + moveohmi(sp, 240); Serial.println("ohmi move 215deg"); delay(1000); @@ -247,7 +245,6 @@ void demo(){ } Serial.println("ohmi move circle"); delay(1000); - } void loop(){ demo(); |
