![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is some awesome robot code
Dependencies: mbed-rtos mbed QEI
Fork of ICRSEurobot13 by
Diff: main.cpp
- Revision:
- 67:be3ea5450cc7
- Parent:
- 64:c979fb1cd3b5
- Parent:
- 65:4709ff6c753c
- Child:
- 71:eb1956c2d316
diff -r f1d75e51398d -r be3ea5450cc7 main.cpp --- a/main.cpp Sun Apr 14 17:22:20 2013 +0000 +++ b/main.cpp Sun Apr 14 18:47:17 2013 +0000 @@ -40,6 +40,7 @@ //motorencodetestline(); //motorsandservostest(); //armtest(); + //while(1); //motortestline(); //ledtest(); //phototransistortest(); @@ -272,22 +273,74 @@ } } */ +#ifdef AGDHGADSYIGYJDGA +PwmOut white(p26); +PwmOut black(p25); - +void armtest() +{ + + white.period(0.05); + black.period(0.05); + + /* float f=1; + for (f=1; f<3; f+=0.1) + { + black.pulsewidth_us(f*1000); + wait(1); + printf("%f\r\n", f); + } + for (f=2; f>0; f-=0.1) + { + black.pulsewidth_us(f*1000); + wait(1); + printf("%f\r\n", f); + }*/ + + + for(;;) + { + black.pulsewidth_us(2.0*1000); + wait(2); + black.pulsewidth_us(0.9*1000);//1.2 + wait(2); + } + + // white works + /*for(;;) + { + white.pulsewidth_us(0.6*1000); + wait(2); + white.pulsewidth_us(2.5*1000); + wait(2); + }*/ + + /* while(1) //2.5 -> //0.6 + { + white.pulsewidth_us(int(f*1000)); + printf("%f\r\n", f); + f-=0.1; + wait(1); + }*/ +} +#endif +#ifdef FSDHGFSJDF void armtest() { - Arm white(p26), black(p25, false, 0.0005, 180); - while(true) { - white(0); - black(0); - wait(1); - white(1); - black(1); - wait(1); + Arm lower_arm(p25, 0.05, 0.9, 2.0); + Arm upper_arm(p26, 0.05, 0.6, 2.5); + + while(1) + { + upper_arm.go_up(); + wait(2); + upper_arm.go_down(); + wait(2); } } - - +#endif +void armtest(){} +/* void motorsandservostest() { Encoder Eleft(p27, p28), Eright(p30, p29); @@ -328,7 +381,7 @@ if (servoTimer.read() >= 9) servoTimer.reset(); } } - +*/ void motortestline() { MainMotor mleft(p24,p23), mright(p21,p22);