Barobo
PortalSign In
HomeShopTutorialsFree CurriculumHour of Code
RoboBlockly for Learning Math and Coding

4Square

Piano
Linkbot Image Mindstorm Image
0x2418126-6-12y2418126-6-12
Grid:
Tics Lines:
Width px
Hash Lines:
Width px
Labels:
Font px
Trace Lines:
Robot 1:
Width px
Robot 2:
Width px
Robot 3:
Width px
Robot 4:
Width px
Labels: x-axis y-axis Show Grid
Grid: 12x12 inches 24x24 inches 36x36 inches
72x72 inches 96x96 inches 192x192 inches
Quad: 4 Quadrants 1 Quadrant 1&4 Quadrants
Units: US Customary Metric
Background: Background Image

Robot 1

0
S
M
L
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (0 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 2

0
S
M
L
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (6 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 3

0
S
M
L
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (12 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 4

0
S
M
L
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (18 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in
4-Square in Synch
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
#include <linkbot.h>

CPlot plot;
CLinkbotI robot1;
double radius1 = 1.75;
CLinkbotI robot2;
double radius2 = 1.75;
CLinkbotI robot3;
double radius3 = 1.75;
CLinkbotI robot4;
double radius4 = 1.75;
double trackwidth1 = 3.69;
double trackwidth2 = 3.69;
double trackwidth3 = 3.69;
double trackwidth4 = 3.69;
int count;

count = 0;
while(count < 4) {
  plot.backgroundColor(randcolor());
  plot.lineStyle("--");
  robot1.driveDistanceNB(5, radius1);
  robot2.driveDistanceNB(5, radius2);
  robot3.driveDistanceNB(5, radius3);
  robot4.driveDistance(5, radius4);
  robot1.turnRightNB(90, radius1, trackwidth1);
  robot2.turnRightNB(90, radius2, trackwidth2);
  robot3.turnRightNB(90, radius3, trackwidth3);
  robot4.turnRight(90, radius4, trackwidth4);
  count = count + 1;
}
plot.text("Hello dude", PLOT_TEXT_LEFT, 6, 8);

plot.label(PLOT_AXIS_XY, "");
plot.grid(PLOT_OFF);
plot.tics(PLOT_AXIS_XY, PLOT_OFF);
plot.axis(PLOT_AXIS_XY, PLOT_OFF);
plot.axisRange(PLOT_AXIS_XY, -12, 24);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
Load Blocks
Hardware
LArduino
Workspace Show Ch Save File
Problem Statement:

Create 4 robots that draw a square at the same time and change the background each time they complete a movement.

Add a message to the screen when you finish!


		
Rubbish bin
Time