Xojo Dojo is a free and easy way to get started with programming on the Raspberry Pi. With Xojo Dojo you can use the Xojo programming language, along with a few other special commands to make simple Pi programs that can use text, graphics and GPIO.
Download Xojo Dojo to your Raspberry Pi and unzip it. Go to the XojoDojo folder and double-click the XojoDojo executable.
If the file is nor marked as an executable file, you may have to manually do this by right-clicking on it, and selecting "Properties". Switch to the Permissions tab and in the Access Control section make sure Executable is set to "Anyone". Click OK.
When Xojo Dojo starts it displays an empty window that is the code editor.
You can type some code to get started. For example, this simple code displays text:
Print "Hello, World!"
Type that code and click Run in the toolbar. Xojo Dojo will switch to the Text tab and you'll see the output "Hello, World!".
Xojo Dojo includes several sample projects to show you some of its commands and capabilities. To look at an example project, click Open in the File menu and go to the Scripts folder in the XojoDojo folder. These are the included examples:
- Bounce: A graphics demo that draws a ball that leaves a multi-colored trail as it bounces around the screen. Press the Stop button on the toolbar to stop the demo.
- Boxes: A graphics demo that draws 1000 multi-colored boxes of varying sizes on the screen.
- BubbleSort: An implemention of the Bubble Sort sorting algorithm.
- DiceRoll: Simulates the rolling of two dice a certain number of times and then tells you how often each dice total amount occurred.
- DragonSweep: A graphics demo that draws a fractal "dragon". Based on an IBM PCjr BASIC program from Compute! magazine in March 1986.
- GPIOAlarm: With a piezo speaker wired to your Pi using the GPIO, this program makes it sound like an alarm. View the wiring diagram.
- GPIOButtonLED: With a a button and LED wired to your Pi using the GPIO, this program lights the LED when the button is pressed. View the wiring diagram.
- GPIOLEDBlink: With an LED wired to your Pi using GPIO, this program makes the LED blink. View the wiring diagram.
- GPIOTune: With a piezo speaker wired to your Pi using the GPIO, this program plays a short tune. View the wiring diagram.
- GuessTheNumber: Try to guess a number picked by the program.
- HelloWorld: Simple display of text.
- LongLoop: A long-running loop that outputs text.
- MazePattern: Displays a text output that looks like a maze (but is not a maze). Based on a Commodore 64 BASIC program from 10 PRINT.
- Olympic: Draws the Olympic rings.
- ShowPicture: Prompts you to choose a picture on your drive and displays it.
- Sieve: Calculates the Sieve of Eratosthenes, popular benchmarking program in the 1980s.
- SineWave: Displays a text-based sine wave.
Xojo Dojo uses XojoScript and can thus use all the language commands that are part of Xojo. Xojo Dojo cannot use any of the Xojo frameworks.
Xojo Dojo has its own small set of custom commands it can use, which are described below.
Clears the Graphics output screen.
Clears the Text output screen.
Draws a line from position x1, y1 to position x2, y2.
Draws an oval at position x, y and using with w and height h. To draw a circle, make w and h the same.
Draw the picture at the specified path at position x, y.
Draws a rectangle at position x, y using width w and height h.
Draws a string s on the graphics screen at position x, y. Optionally specify a width and whether the string is condensed if it cannot fit.
The end of line character to use with strings.
Stops a timer started with StartTimer, returning the milliseconds of the elapsed time.
Draws a filled oval at position x, y and using with w and height h. To draw a circle, make w and h the same. Change the fill color using the ForeColor command.
Draws a filled rectangle rectangle at position x, y using width w and height h. Change the fill color using the ForeColor command.
Sets the color to use for drawing and fill commands.
Read a value from a GPIO pin.
Write a value to a GPIO pin.
Set a GPIO pin as either input or output.
Initialize GPIO. WiringPi library must be installed on the Pi.
Sets up tones for a pin.
Sends a tone to a pin.
Used with GPIO DigitalRead and DigitalWrite commands to indicate a pin is for input.
Used with GPIO DigitalRead and DigitalWrite commands to indicate a pin is off.
Used with GPIO DigitalRead and DigitalWrite commands to indicate a pin is on.
Used with GPIO DigitalRead and DigitalWrite commands to indicate a pin is for output.
Generates a random integer between startValue and endValue (inclusive).
Switches to the graphics output screen.
Starts a timer.
Returns True when the user has clicked the Stop button on the toolbar. Use it to end your programs that run in a long loop.
Pauses your program execution. The default is 10 milliseconds, but you can specify your own value.
If you want to make full-featured apps for the Raspberry Pi you can try the full version of Xojo. You can also check out the free book: Programming the Raspberry Pi with Xojo and the Raspberry Pi topic of the User Guide.