2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Committer:
madcowswe
Date:
Wed Apr 10 02:01:51 2013 +0000
Revision:
25:b16f1045108f
Parent:
24:50805ef8c499
Parent:
23:5cfc4789e00b
Child:
28:4e20b44251c6
Child:
30:791739422122
Motion and motor works, but needs tuning

Who changed what in which revision?

UserRevisionLine numberNew contents of line
madcowswe 20:70d651156779 1 #include "globals.h"
madcowswe 20:70d651156779 2 #include "Kalman.h"
twighk 0:200635fa1b08 3 #include "mbed.h"
twighk 13:d4b5851742a3 4 #include "rtos.h"
madcowswe 21:167dacfe0b14 5 #include "Arm.h"
madcowswe 21:167dacfe0b14 6 #include "MainMotor.h"
madcowswe 21:167dacfe0b14 7 #include "Encoder.h"
madcowswe 21:167dacfe0b14 8 #include "Colour.h"
madcowswe 21:167dacfe0b14 9 #include "CakeSensor.h"
madcowswe 21:167dacfe0b14 10 #include "Printing.h"
madcowswe 20:70d651156779 11 #include "coprocserial.h"
madcowswe 12:76c9915db820 12 #include <algorithm>
rsavitski 24:50805ef8c499 13 #include "motion.h"
madcowswe 25:b16f1045108f 14 #include "MotorControl.h"
madcowswe 20:70d651156779 15
twighk 0:200635fa1b08 16 void motortest();
twighk 0:200635fa1b08 17 void encodertest();
twighk 0:200635fa1b08 18 void motorencodetest();
twighk 0:200635fa1b08 19 void motorencodetestline();
twighk 0:200635fa1b08 20 void motorsandservostest();
twighk 1:8119211eae14 21 void armtest();
twighk 2:45da48fab346 22 void motortestline();
twighk 3:717de74f6ebd 23 void ledtest();
twighk 3:717de74f6ebd 24 void phototransistortest();
twighk 3:717de74f6ebd 25 void ledphototransistortest();
twighk 3:717de74f6ebd 26 void colourtest();
twighk 8:69bdf20cb525 27 void cakesensortest();
twighk 13:d4b5851742a3 28 void printingtestthread(void const*);
twighk 13:d4b5851742a3 29 void printingtestthread2(void const*);
madcowswe 12:76c9915db820 30 void feedbacktest();
twighk 0:200635fa1b08 31
twighk 0:200635fa1b08 32 int main() {
twighk 2:45da48fab346 33
twighk 3:717de74f6ebd 34 /*****************
twighk 3:717de74f6ebd 35 * Test Code *
twighk 3:717de74f6ebd 36 *****************/
twighk 0:200635fa1b08 37 //motortest();
twighk 0:200635fa1b08 38 //encodertest();
twighk 8:69bdf20cb525 39 //motorencodetest();
twighk 1:8119211eae14 40 //motorencodetestline();
twighk 0:200635fa1b08 41 //motorsandservostest();
twighk 3:717de74f6ebd 42 //armtest();
twighk 2:45da48fab346 43 //motortestline();
twighk 11:bbddc908c78c 44 //ledtest();
twighk 3:717de74f6ebd 45 //phototransistortest();
madcowswe 12:76c9915db820 46 //ledphototransistortest();
madcowswe 5:56a5fdd373c9 47 //colourtest(); // Red SnR too low
madcowswe 12:76c9915db820 48 //cakesensortest();
madcowswe 20:70d651156779 49 //feedbacktest();
madcowswe 15:9c5aaeda36dc 50
madcowswe 20:70d651156779 51 /*
twighk 13:d4b5851742a3 52 DigitalOut l1(LED1);
madcowswe 21:167dacfe0b14 53 Thread p(Printing::printingloop, NULL, osPriorityNormal, 2048);
twighk 13:d4b5851742a3 54 l1=1;
twighk 13:d4b5851742a3 55 Thread a(printingtestthread, NULL, osPriorityNormal, 1024);
twighk 13:d4b5851742a3 56 Thread b(printingtestthread2, NULL, osPriorityNormal, 1024);
twighk 13:d4b5851742a3 57 Thread::wait(osWaitForever);
madcowswe 15:9c5aaeda36dc 58 */
madcowswe 16:52250d8d8fce 59
madcowswe 22:6e3218cf75f8 60 SystemTime.start();
madcowswe 20:70d651156779 61
madcowswe 25:b16f1045108f 62 Serial pc(USBTX, USBRX);
madcowswe 25:b16f1045108f 63 pc.baud(115200);
madcowswe 25:b16f1045108f 64
rsavitski 24:50805ef8c499 65 using AI::current_waypoint;
madcowswe 25:b16f1045108f 66
rsavitski 24:50805ef8c499 67 current_waypoint = new Waypoint;
rsavitski 24:50805ef8c499 68 current_waypoint->x = 0.5;
rsavitski 24:50805ef8c499 69 current_waypoint->y = 0.7;
rsavitski 24:50805ef8c499 70 current_waypoint->theta = 0.0;
rsavitski 24:50805ef8c499 71 current_waypoint->pos_threshold = 0.02;
rsavitski 24:50805ef8c499 72 current_waypoint->angle_threshold = 0.09;
madcowswe 20:70d651156779 73
madcowswe 20:70d651156779 74 InitSerial();
madcowswe 20:70d651156779 75 //while(1)
madcowswe 20:70d651156779 76 // printbuff();
madcowswe 20:70d651156779 77 wait(1);
madcowswe 20:70d651156779 78 Kalman::KalmanInit();
madcowswe 20:70d651156779 79
madcowswe 20:70d651156779 80 Thread predictthread(Kalman::predictloop, NULL, osPriorityNormal, 2084);//512); //temp 2k
madcowswe 20:70d651156779 81
madcowswe 20:70d651156779 82 Kalman::start_predict_ticker(&predictthread);
rsavitski 24:50805ef8c499 83
madcowswe 25:b16f1045108f 84 Ticker motorcontroltestticker;
madcowswe 25:b16f1045108f 85 motorcontroltestticker.attach(MotorControl::motor_control_isr, 0.05);
madcowswe 22:6e3218cf75f8 86
rsavitski 24:50805ef8c499 87 // motion layer periodic callback
rsavitski 24:50805ef8c499 88 RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic);
rsavitski 24:50805ef8c499 89 motion_timer.start(50);
madcowswe 25:b16f1045108f 90
madcowswe 25:b16f1045108f 91
madcowswe 21:167dacfe0b14 92 Thread::wait(3500);
madcowswe 21:167dacfe0b14 93 Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048);
madcowswe 25:b16f1045108f 94
madcowswe 21:167dacfe0b14 95 Thread::wait(osWaitForever);
madcowswe 25:b16f1045108f 96
madcowswe 12:76c9915db820 97 }
madcowswe 12:76c9915db820 98
twighk 13:d4b5851742a3 99 #include <cstdlib>
twighk 13:d4b5851742a3 100 using namespace std;
twighk 13:d4b5851742a3 101
twighk 13:d4b5851742a3 102 void printingtestthread(void const*){
twighk 13:d4b5851742a3 103 const char ID = 1;
twighk 13:d4b5851742a3 104 float buffer[3] = {ID};
madcowswe 21:167dacfe0b14 105 Printing::registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
twighk 13:d4b5851742a3 106 while (true){
twighk 13:d4b5851742a3 107 for(size_t i = 1; i != sizeof(buffer)/sizeof(buffer[0]); ++i){
madcowswe 20:70d651156779 108 buffer[i] = ID ;
twighk 13:d4b5851742a3 109 }
madcowswe 21:167dacfe0b14 110 Printing::updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
twighk 13:d4b5851742a3 111 Thread::wait(200);
twighk 13:d4b5851742a3 112 }
twighk 13:d4b5851742a3 113 }
madcowswe 14:c638d4b9ee94 114
twighk 13:d4b5851742a3 115 void printingtestthread2(void const*){
twighk 13:d4b5851742a3 116 const char ID = 2;
twighk 13:d4b5851742a3 117 float buffer[5] = {ID};
madcowswe 21:167dacfe0b14 118 Printing::registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
twighk 13:d4b5851742a3 119 while (true){
twighk 13:d4b5851742a3 120 for(size_t i = 1; i != sizeof(buffer)/sizeof(buffer[0]); ++i){
twighk 13:d4b5851742a3 121 buffer[i] = ID;
twighk 13:d4b5851742a3 122 }
madcowswe 21:167dacfe0b14 123 Printing::updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
twighk 13:d4b5851742a3 124 Thread::wait(500);
twighk 13:d4b5851742a3 125 }
twighk 8:69bdf20cb525 126 }
twighk 8:69bdf20cb525 127
madcowswe 25:b16f1045108f 128
rsavitski 24:50805ef8c499 129 /*
madcowswe 12:76c9915db820 130 void feedbacktest(){
madcowswe 20:70d651156779 131 //Encoder Eright(P_ENC_RIGHT_A, P_ENC_RIGHT_B), Eleft(P_ENC_LEFT_A, P_ENC_LEFT_B);
madcowswe 12:76c9915db820 132 MainMotor mright(P_MOT_RIGHT_A, P_MOT_RIGHT_B), mleft(P_MOT_LEFT_A, P_MOT_LEFT_B);
madcowswe 12:76c9915db820 133
madcowswe 20:70d651156779 134 Kalman::State state;
madcowswe 20:70d651156779 135
madcowswe 20:70d651156779 136 float Pgain = -0.01;
madcowswe 15:9c5aaeda36dc 137 float fwdspeed = -400/3.0f;
madcowswe 12:76c9915db820 138 Timer timer;
madcowswe 12:76c9915db820 139 timer.start();
madcowswe 12:76c9915db820 140
madcowswe 12:76c9915db820 141 while(true){
madcowswe 12:76c9915db820 142 float expecdist = fwdspeed * timer.read();
madcowswe 20:70d651156779 143 state = Kalman::getState();
madcowswe 20:70d651156779 144 float errleft = left_encoder.getTicks() - (expecdist);
madcowswe 20:70d651156779 145 float errright = right_encoder.getTicks() - expecdist;
madcowswe 12:76c9915db820 146
madcowswe 12:76c9915db820 147 mleft(max(min(errleft*Pgain, 0.4f), -0.4f));
madcowswe 12:76c9915db820 148 mright(max(min(errright*Pgain, 0.4f), -0.4f));
madcowswe 12:76c9915db820 149 }
twighk 8:69bdf20cb525 150 }
rsavitski 24:50805ef8c499 151 */
madcowswe 25:b16f1045108f 152
twighk 8:69bdf20cb525 153 void cakesensortest(){
twighk 8:69bdf20cb525 154 wait(1);
madcowswe 20:70d651156779 155 printf("cakesensortest");
twighk 8:69bdf20cb525 156
twighk 11:bbddc908c78c 157 CakeSensor cs(P_COLOR_SENSOR_IN);
twighk 8:69bdf20cb525 158 while(true){
twighk 8:69bdf20cb525 159 wait(0.1);
madcowswe 20:70d651156779 160 printf("distance: %f\t %f\r\n", cs.Distance(),cs.Distanceincm());
twighk 8:69bdf20cb525 161 }
twighk 3:717de74f6ebd 162 }
twighk 3:717de74f6ebd 163
twighk 3:717de74f6ebd 164 void colourtest(){
madcowswe 7:4340355261f9 165 Colour c(P_COLOR_SENSOR_BLUE, P_COLOR_SENSOR_RED, P_COLOR_SENSOR_IN);
twighk 3:717de74f6ebd 166 c.Calibrate();
twighk 3:717de74f6ebd 167 while(true){
twighk 3:717de74f6ebd 168 wait(0.1);
twighk 3:717de74f6ebd 169 ColourEnum ce = c.getColour();
twighk 3:717de74f6ebd 170 switch(ce){
twighk 3:717de74f6ebd 171 case BLUE :
madcowswe 20:70d651156779 172 printf("BLUE\n\r");
twighk 3:717de74f6ebd 173 break;
twighk 3:717de74f6ebd 174 case RED:
madcowswe 20:70d651156779 175 printf("RED\n\r");
twighk 3:717de74f6ebd 176 break;
twighk 3:717de74f6ebd 177 case WHITE:
madcowswe 20:70d651156779 178 printf("WHITE\n\r");
twighk 3:717de74f6ebd 179 break;
twighk 3:717de74f6ebd 180 case INCONCLUSIVE:
madcowswe 20:70d651156779 181 printf("INCONCLUSIVE\n\r");
twighk 3:717de74f6ebd 182 break;
twighk 3:717de74f6ebd 183 default:
madcowswe 20:70d651156779 184 printf("BUG\n\r");
twighk 3:717de74f6ebd 185 }
twighk 2:45da48fab346 186 }
twighk 0:200635fa1b08 187
twighk 3:717de74f6ebd 188 }
twighk 3:717de74f6ebd 189
twighk 3:717de74f6ebd 190
twighk 3:717de74f6ebd 191 void ledphototransistortest(){
madcowswe 7:4340355261f9 192 DigitalOut blue(P_COLOR_SENSOR_BLUE), red(P_COLOR_SENSOR_RED);
madcowswe 7:4340355261f9 193 AnalogIn pt(P_COLOR_SENSOR_IN);
twighk 3:717de74f6ebd 194 Serial pc(USBTX, USBRX);
twighk 3:717de74f6ebd 195
twighk 3:717de74f6ebd 196 while(true){
twighk 11:bbddc908c78c 197 blue = 0; red = 0;
twighk 11:bbddc908c78c 198 for(int i = 0; i != 5; i++){
twighk 11:bbddc908c78c 199 wait(0.1);
madcowswe 20:70d651156779 200 printf("Phototransistor Analog is (none): %f \n\r", pt.read());
twighk 11:bbddc908c78c 201 }
twighk 11:bbddc908c78c 202
madcowswe 7:4340355261f9 203 blue = 1; red = 0;
twighk 3:717de74f6ebd 204 for(int i = 0; i != 5; i++){
twighk 3:717de74f6ebd 205 wait(0.1);
madcowswe 20:70d651156779 206 printf("Phototransistor Analog is (blue): %f \n\r", pt.read());
twighk 3:717de74f6ebd 207 }
madcowswe 7:4340355261f9 208 blue = 0; red = 1;
twighk 3:717de74f6ebd 209 for(int i = 0; i != 5; i++){
twighk 3:717de74f6ebd 210 wait(0.1);
madcowswe 20:70d651156779 211 printf("Phototransistor Analog is (red ): %f \n\r", pt.read());
twighk 3:717de74f6ebd 212 }
twighk 11:bbddc908c78c 213 blue = 1; red = 1;
twighk 11:bbddc908c78c 214 for(int i = 0; i != 5; i++){
twighk 11:bbddc908c78c 215 wait(0.1);
madcowswe 20:70d651156779 216 printf("Phototransistor Analog is (both): %f \n\r", pt.read());
twighk 11:bbddc908c78c 217 }
twighk 3:717de74f6ebd 218 }
twighk 3:717de74f6ebd 219 }
twighk 3:717de74f6ebd 220
twighk 3:717de74f6ebd 221 void phototransistortest(){
madcowswe 7:4340355261f9 222 AnalogIn pt(P_COLOR_SENSOR_IN);
twighk 3:717de74f6ebd 223 while(true){
twighk 3:717de74f6ebd 224 wait(0.1);
madcowswe 20:70d651156779 225 printf("Phototransistor Analog is: %f \n\r", pt.read());
twighk 3:717de74f6ebd 226 }
twighk 3:717de74f6ebd 227
twighk 3:717de74f6ebd 228 }
twighk 3:717de74f6ebd 229
twighk 3:717de74f6ebd 230 void ledtest(){
madcowswe 7:4340355261f9 231 DigitalOut blue(P_COLOR_SENSOR_BLUE), red(P_COLOR_SENSOR_RED);
twighk 3:717de74f6ebd 232 while(true){
madcowswe 7:4340355261f9 233 blue = 1; red = 0;
twighk 3:717de74f6ebd 234 wait(0.2);
madcowswe 7:4340355261f9 235 blue = 0; red = 1;
twighk 3:717de74f6ebd 236 wait(0.2);
twighk 3:717de74f6ebd 237
twighk 3:717de74f6ebd 238 }
twighk 3:717de74f6ebd 239 }
twighk 3:717de74f6ebd 240
twighk 1:8119211eae14 241 void armtest(){
twighk 3:717de74f6ebd 242 Arm white(p26), black(p25, false, 0.0005, 180);
twighk 3:717de74f6ebd 243 while(true){
twighk 1:8119211eae14 244 white(0);
twighk 1:8119211eae14 245 black(0);
twighk 1:8119211eae14 246 wait(1);
twighk 1:8119211eae14 247 white(1);
twighk 1:8119211eae14 248 black(1);
twighk 1:8119211eae14 249 wait(1);
twighk 1:8119211eae14 250 }
twighk 1:8119211eae14 251 }
twighk 1:8119211eae14 252
twighk 1:8119211eae14 253
twighk 0:200635fa1b08 254 void motorsandservostest(){
twighk 0:200635fa1b08 255 Encoder Eleft(p27, p28), Eright(p30, p29);
twighk 0:200635fa1b08 256 MainMotor mleft(p24,p23), mright(p21,p22);
twighk 1:8119211eae14 257 Arm sTop(p25), sBottom(p26);
twighk 4:1be0f6c6ceae 258 //Serial pc(USBTX, USBRX);
twighk 0:200635fa1b08 259 const float speed = 0.0;
twighk 0:200635fa1b08 260 const float dspeed = 0.0;
twighk 0:200635fa1b08 261
twighk 0:200635fa1b08 262 Timer servoTimer;
twighk 0:200635fa1b08 263 mleft(speed); mright(speed);
twighk 0:200635fa1b08 264 servoTimer.start();
twighk 0:200635fa1b08 265 while (true){
madcowswe 20:70d651156779 266 printf("Position is: %i \t %i \n\r", Eleft.getTicks(), Eright.getTicks());
madcowswe 20:70d651156779 267 if (Eleft.getTicks() < Eright.getTicks()){
twighk 0:200635fa1b08 268 mleft(speed);
twighk 0:200635fa1b08 269 mright(speed - dspeed);
twighk 0:200635fa1b08 270 } else {
twighk 0:200635fa1b08 271 mright(speed);
twighk 0:200635fa1b08 272 mleft(speed - dspeed);
twighk 0:200635fa1b08 273 }
twighk 0:200635fa1b08 274 if (servoTimer.read() < 1){
twighk 0:200635fa1b08 275 sTop.clockwise();
twighk 0:200635fa1b08 276 } else if (servoTimer.read() < 4) {
twighk 2:45da48fab346 277 sTop.halt();
twighk 0:200635fa1b08 278 } else if (servoTimer.read() < 5) {
twighk 0:200635fa1b08 279 sBottom.anticlockwise();
twighk 0:200635fa1b08 280 //Led=1;
twighk 0:200635fa1b08 281 } else if (servoTimer.read() < 6) {
twighk 0:200635fa1b08 282 sBottom.clockwise();
twighk 0:200635fa1b08 283 //Led=0;
twighk 0:200635fa1b08 284 } else if (servoTimer.read() < 7) {
twighk 2:45da48fab346 285 sBottom.halt();
twighk 0:200635fa1b08 286 }else {
twighk 0:200635fa1b08 287 sTop.anticlockwise();
twighk 0:200635fa1b08 288 }
twighk 0:200635fa1b08 289 if (servoTimer.read() >= 9) servoTimer.reset();
twighk 0:200635fa1b08 290 }
twighk 0:200635fa1b08 291 }
twighk 0:200635fa1b08 292
twighk 2:45da48fab346 293 void motortestline(){
twighk 2:45da48fab346 294 MainMotor mleft(p24,p23), mright(p21,p22);
twighk 2:45da48fab346 295 const float speed = 0.2;
twighk 2:45da48fab346 296 mleft(speed); mright(speed);
twighk 2:45da48fab346 297 while(true) wait(1);
twighk 2:45da48fab346 298 }
twighk 2:45da48fab346 299
twighk 0:200635fa1b08 300 void motorencodetestline(){
madcowswe 12:76c9915db820 301 Encoder Eright(P_ENC_RIGHT_A, P_ENC_RIGHT_B), Eleft(P_ENC_LEFT_A, P_ENC_LEFT_B);
madcowswe 12:76c9915db820 302 MainMotor mright(P_MOT_RIGHT_A, P_MOT_RIGHT_B), mleft(P_MOT_LEFT_A, P_MOT_LEFT_B);
twighk 4:1be0f6c6ceae 303 //Serial pc(USBTX, USBRX);
twighk 0:200635fa1b08 304 const float speed = 0.2;
twighk 0:200635fa1b08 305 const float dspeed = 0.1;
twighk 0:200635fa1b08 306
twighk 0:200635fa1b08 307 mleft(speed); mright(speed);
twighk 0:200635fa1b08 308 while (true){
twighk 0:200635fa1b08 309 //left 27 cm = 113 -> 0.239 cm/pulse
twighk 0:200635fa1b08 310 //right 27 cm = 72 -> 0.375 cm/pulse
madcowswe 20:70d651156779 311 printf("Position is: %i \t %i \n\r", (int)(Eleft.getTicks()*0.239), (int)(Eright.getTicks()*0.375));
madcowswe 20:70d651156779 312 if (Eleft.getTicks()*0.239 < Eright.getTicks()*0.375){
twighk 0:200635fa1b08 313 mright(speed - dspeed);
twighk 0:200635fa1b08 314 } else {
twighk 0:200635fa1b08 315 mright(speed + dspeed);
twighk 0:200635fa1b08 316 }
twighk 0:200635fa1b08 317 }
twighk 0:200635fa1b08 318
twighk 0:200635fa1b08 319 }
twighk 0:200635fa1b08 320
twighk 0:200635fa1b08 321 void motorencodetest(){
madcowswe 7:4340355261f9 322 Encoder Eright(P_ENC_RIGHT_A, P_ENC_RIGHT_B), Eleft(P_ENC_LEFT_A, P_ENC_LEFT_B);
madcowswe 7:4340355261f9 323 MainMotor mright(P_MOT_RIGHT_A, P_MOT_RIGHT_B), mleft(P_MOT_LEFT_A, P_MOT_LEFT_B);
twighk 0:200635fa1b08 324 Serial pc(USBTX, USBRX);
twighk 0:200635fa1b08 325
twighk 0:200635fa1b08 326 const float speed = -0.3;
twighk 0:200635fa1b08 327 const int enc = -38;
twighk 0:200635fa1b08 328 while(true){
twighk 0:200635fa1b08 329 mleft(speed); mright(0);
madcowswe 20:70d651156779 330 while(Eleft.getTicks()>enc){
madcowswe 20:70d651156779 331 printf("Position is: %i \t %i \n\r", Eleft.getTicks(), Eright.getTicks());
twighk 0:200635fa1b08 332 }
twighk 0:200635fa1b08 333 Eleft.reset(); Eright.reset();
twighk 0:200635fa1b08 334 mleft(0); mright(speed);
madcowswe 20:70d651156779 335 while(Eright.getTicks()>enc){
madcowswe 20:70d651156779 336 printf("Position is: %i \t %i \n\r", Eleft.getTicks(), Eright.getTicks());
twighk 0:200635fa1b08 337 }
twighk 0:200635fa1b08 338 Eleft.reset(); Eright.reset();
twighk 0:200635fa1b08 339 }
twighk 0:200635fa1b08 340 }
twighk 0:200635fa1b08 341
twighk 0:200635fa1b08 342 void encodertest(){
madcowswe 15:9c5aaeda36dc 343 Encoder E1(P_ENC_LEFT_A, P_ENC_LEFT_B);
madcowswe 15:9c5aaeda36dc 344 //Encoder E2(P_ENC_RIGHT_A, P_ENC_RIGHT_B);
twighk 0:200635fa1b08 345 Serial pc(USBTX, USBRX);
twighk 3:717de74f6ebd 346 while(true){
twighk 0:200635fa1b08 347 wait(0.1);
madcowswe 20:70d651156779 348 printf("Position is: %i \t %i \n\r", E1.getTicks(), 0);//E2.getTicks());
twighk 0:200635fa1b08 349 }
twighk 0:200635fa1b08 350
twighk 0:200635fa1b08 351 }
twighk 0:200635fa1b08 352 void motortest(){
twighk 0:200635fa1b08 353 MainMotor mright(p22,p21), mleft(p23,p24);
twighk 3:717de74f6ebd 354 while(true) {
twighk 0:200635fa1b08 355 wait(1);
twighk 0:200635fa1b08 356 mleft(0.8); mright(0.8);
twighk 0:200635fa1b08 357 wait(1);
twighk 0:200635fa1b08 358 mleft(-0.2); mright(0.2);
twighk 0:200635fa1b08 359 wait(1);
twighk 0:200635fa1b08 360 mleft(0); mright(0);
twighk 0:200635fa1b08 361 }
twighk 0:200635fa1b08 362 }