Grisbot in Scratch Challenge Screen

The first thing you have to do when creating a program is draw the user interface. This is actually pretty simple in Scratch, because you can simply draw an interface in a painting program and then load the graphics file as the background for your Scratch program.

Here is the main screen, the Challenge Screen:

gris screen 01

The Challenges are increasingly difficult paths that the user must program the robot to navigate through. (Note that this is different from my previous Processing-based GRIS program, in that now the path is pre-drawn.)

Rather than create the path, the user clicks on each waypoint of the pre-drawn path. Status information for the selected waypoint then appears at the bottom of the screen. The user selects the L/R (Left/Right) and F/B (Forward/Backward) buttons, then clicks on the green-on-black servo timing bars as desired. The green bar stretches to the click point, and the position of the click on the bar translates into a servo timing value.

As shown here, the user has selected Waypoint 3, and has chosen appropriate servo timing values. Since this is the last waypoint, now it’s time to click the button at the lower right and go to the communications screen, where the data for turns and moves will be sent to the robot as flashes of light. Then the user sets the robot down on the course (at Waypoint Zero, natch!) and away we go.

Which servo timing values are correct? Well, finding that out is the goal of the challenge. It may take several trial and error runs to get it right. I anticipate up to ten pre-drawn challenges, and users will have the option of making their own challenges too.

My hope is that younger kids will be interested in playing the game, mid-age kids will enjoy building the robot kit, and older kids will want to hack the robot with their own software and hardware modifications.

What if it turns out that I can’t send the light signals using Scratch? Well, then maybe I can write the program as a sketch in Processing that would run inside a web browser.

About engineerzero

Once and future engineer.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s