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.
Revision 1:757f571d9e14, committed 2014-01-30
- Comitter:
- nekoyyy
- Date:
- Thu Jan 30 05:27:11 2014 +0000
- Parent:
- 0:7460a219f05f
- Commit message:
- ????
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 14 09:52:37 2013 +0000 +++ b/main.cpp Thu Jan 30 05:27:11 2014 +0000 @@ -4,16 +4,27 @@ PwmOut servo1(p21); PwmOut servo2(p22); PwmOut servo3(p23); +PwmOut servo4(p24); +PwmOut servo5(p25); +PwmOut servo6(p26); -float p = 0.049f; -float q=0.097f; -float r=0.045f; +float p = 0.057f; //1go-ki syoki iti +float q = 0.101f; +float r = 0.087f; + +float s = 0.031f; //2go-ki syoki iti +float t = 0.118f; +float u = 0.080f; + int main() { pc.printf("Press q e a d z c\n"); servo1=p; servo2=q; servo3=r; + servo4=s; + servo5=t; + servo6=u; while(1) { char c = pc.getc(); if(c == 'q'){ @@ -42,10 +53,46 @@ servo3=r; } + +if(c == 'u'){ + s += 0.001f; + servo4=s; + } + + if(c == 'o'){ + s -= 0.001f; + servo4 = s; + } if(c == 'h'){ + t += 0.001f; + servo5=t; + } + + if(c == 'k'){ + t -= 0.001f; + servo5 = t; + } if(c == 'b'){ + u += 0.001f; + servo6=u; + } + + if(c == 'm'){ + u -= 0.001f; + servo6=u; + } + + if(c == 't'){ pc.printf("p=%f\n", p); pc.printf("q=%f\n", q); - pc.printf("r=%f\n", r); + pc.printf("r=%f\n", r); + } + if(c == 'y'){ + pc.printf("s=%f\n", s); + + pc.printf("t=%f\n", t); + + pc.printf("u=%f\n", u); + } } }