You are on page 1of 2

Ping Ultrasonic Range Finder:

Note: when something gets very close, sometimes the distance jumps very large.
Need to keep this in mind or will cause problems later. Centimeters may be more
accurate then inches.
Connection:

Gameduino2:
GD.ClearColorRGB(0x103000); //it sets the color used for screen clears
GD.Clear(); //It clears the screen to the dark green color. Drawing must always begin with a
clear screen.
GD.cmd_text(240, 136, 31, OPT_CENTER, "Hello world"); //(x,y,FontSize) 240,136 is center of
screen. 31 largest font and opt_center makes the center of the at the x,y.
GD.swap(); //drawing is finished and you can make it visible on screen.
GD.PointSize(16 * 30); // means 30 pixels
GD.Begin(POINTS); //allows for drawings to start.
GD.ColorA(128); // makes points 50% transparent
GD.ColorRGB(0xff8000); // orange and it adds color to the points

GD.Vertex2ii(260, 170); //pixel at (x,y)


GD.random(256);//picks a random number 0 -256
GD.play; // to play sounds

There are always two copies of the screen: one that is visible, and one that is work-inprogress.
Screen size: 480 pixels wide and 272 high. 0,0 is top-left

You might also like