Ringo Reference Code

Reference code has been provided in several different categories:

Pre-Loaded Behaviors (Collection) - (Download)Code for the pre-loaded behavior collection. This is the code that was loaded onto Ringo before shipping. This is a single "sketch" file that includes all the behaviors together so they can all be installed at once. Look over the code in the "Behaviors" tab inside the Arduino IDE. Modify it there to change up the behaviors.

Pre-Loaded Behaviors (Individual) - (Download)If you would like to customize or expand upon any one of the pre-loaded behaviors, we've provided each one as a stand-alone sketch. This makes for simple editing and allows lots of extra code space to make Ringo do whatever you want. This is the place to start for growing an example behavior into something more awesome.

Ringo Base Sketch - (Download)The "Base Sketch" is basically an empty template you can use to write your own code and behaviors from nothing. The Base Sketch includes all the low level code that will show as a set of tabs in the Arduino IDE. The setup() function is already written for you. You can simply add your own code inside the main loop() function and go from there. Check out the Guide Book for lessons on writing your own code.

Ringo Guide Companion Code - (Download)This is a folder of sketches that show complete fully working examples of some of the code snips described in the Ringo Guide. Sometimes its helpful to see the entire working sketch together to put the example in perspective. Follow these as you read through the guide.

Ringo Pre-Loaded Behaviors

Ringo's PreLoaded Behaviors can be activated by pressing the corresponding key on the included remote control. This list is for PreLoaded Behaviors Rev05.

Turn on Ringo. He will chirp and flash his eyes blue. He is now waiting to be told which behavior to run. In this waiting mode, his tail will blink blue once a second.

Press a key on the remote to activate the corresponding behavior.

Some behaviors can be exited by pressing the "MENU" button the remote. Others require you press the "Reset" button on Ringo (the button right next to the power switch). You can also reset the behavior by turning Ringo OFF then back ON.

Behavior List:

Drive with RemoteUse remote arrows to drive around. "X" key changes eye color, "A" and "B" change individual eye color, "0" key plays a cheer. Number keys play an octave of notes. Great starting point to make your own remote control driven behavior.

Attack BugRingo uses his accelerometer to determine when poked. Ringo attempts to turn toward the offending poke and attacks. With some editing this could be made into "run away bug". Good base for vibration or touch triggered behavior.

The Ringo DanceSuper simple behavior. Only a few lines of code produces amazingly organic movement. Uses random number generator to drive Ringo's "dance" moves. Could use this as a base for all kinds of "dance" action or random movements.

Spin SqueekAnother simple one. Ringo reads light sensors and when seeing a change over a threshold (like a shadow passing over), he triggers an action. In this case it's spinning with squeek but it could be anything. Great basis for your own light activated behaviors.

Color WheelRingo uses his gyroscope to determine which direction he faces, then makes his eyes match the color of the "color wheel" in that direction. A simple edit makes his tail show the complementary color. Press the User button and Ringo turns a circle by himself.

Follow LightRingo does an amazing job of seeking light. Try this in a dark room and turn on a flashlight. Very sensitive, and the code is easy to follow. Use this as the basis for any light seeking (or running away from) behavior.

Drive SquareUses Ringo's easy automatic navigation functions. These functions use Ringo's accelerometer and gyroscope to move a set direction and make snappy accurate turns. Use this as a basis to learn Ringo's navigation functions.

Maintain HeadingRingo uses his gyroscope to try and hold a heading. Rotate him by hand and he'll return back to his starting heading. Press the User button to reset Ringo to a new heading. This is a good basis for understanding how to deal with the gyroscope as you move toward more advanced behaviors.

Autonomous RoamingPress the "0" key on the remote to start this one. This is a really advanced behavior where Ringo is totally autonomous. He stops at edges or changes in surface color, and sees barriers and avoids them. If he gets stuck in a corner he'll get frustrated and find a new path. This is a good basis for more advanced "I'm a live bug!" behavior development.