//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// /* MultiDemo.c * by Rob Seib, 2014, July * Written for the Lego Multigraph, * This program demonstrates one possible drawing. * It's best tested with the left arm facing the user */ void drawpic() { nMotorEncoder[motorB] = 0; //reset slower motor encoder while(nMotorEncoder[motorB] < 1080)//draw picture { motor[motorB] = 10; motor[motorC] = 30; } motor[motorB] = 0; motor[motorC] = 0; nMotorEncoder[motorA] = 0; while(nMotorEncoder[motorA] < 630)//turn the table 90 degrees { motor[motorA] = 20; } motor[motorA] = 0; } task main() { for (int i = 1; i <= 4; i++) //draw pic1 'i' times { drawpic(); } nxtDisplayStringAt(0,40,"Change Pen Colour"); nxtDisplayStringAt(45,10,"OK"); do // wait for centre button press {} while (nNxtButtonPressed != 3); eraseDisplay(); nMotorEncoder[motorC] = 0; while(nMotorEncoder[motorC] < 63000)//draw spirograph { motor[motorA] = 1; motor[motorC] = 25; } motor[motorA] = 0; motor[motorC] = 0; }