Saturday, October 16, 2010

Turtle Arduino digital write

Turtle art source
Python code block source (Python in open doc format)

Get Turtleart Arduino working with your version of Sugar. Load the Turtle code into TurtleArt Arduino. Load the python code. Then run.
Click with the mouse to switch a digital output.

Labels: , , , ,

Friday, October 15, 2010

Turtle Arduino, display inputs

This Turtle Art Arduino project reads and displays the digital inputs.

Labels: , , ,

Arduino fork of Turtle Art

I tried the Arduino fork (here) (or here) of Turtle Art. This version of the Arduino fork (based on V86) can co-exist with Turtle Blocks. There is another based on V80.

I first loaded Firmata into the Arduino using the Arduino software on a PC. Then I tried to control the Arduino from Turtle Art but got errors:

OS19 Sugar 0.90 fails to start", line 834
OS373pyg Sugar 0.88 fails to start", line 834
OS373pyg Gnome starts but fails line 140
OS67 Sugar 0.84 fails to start permission denied opening USB0
OS67 Gnome permission denied opening USB0
OS67 Gnome (as Superuser) starts but fails line 140
OS767 Sugar 0.82 permission denied opening USB0

Then realised that TurtleArt and the Arduino were set to different baud rates causing the error at line 140:

I edited file line 5 to set the baud rate to 57600

class TAArduino(object):
def __init__(self, baud=57600):

To match the setting in Arduino Standard Firmata (loaded into the Arduino board) line 274


Thes gets Arduino working under Gnome under OS373pyg (and presumably OS67 in Gnome as superuser). The following blocks will flash the light on output 13

To get it working under Sugar (OS373pyg), and presumably Sugar 0.88 and 0.90 builds the following dirty hack worked:, line 834

There is another version,

This can not co-exist with Turtle Blocks, you need to uninstall Turtle blocks first.
After that it still fails on import serial
on OS373pyg. Copy a serial directory from the other version
into the Activity directory gets past that bug.
You also need to set the baud rate as described.


Labels: , , , ,

Tuesday, October 05, 2010

Turtle Pi (another one)

see also turtle-pi

Each side is of length 500/n where there are n sides, so half the perimeter of the closed polygon is of length 500, the polygon is of perimeter 1000, the diameter is xcor

perimeter/diameter approaches pi for large n

En español
Véase también turtle-pi

Cada lado tiene una longitud de 500 / n donde hay n lados, por lo que la mitad del perímetro del polígono cerrado tiene una longitud de 500, el polígono es el perímetro de 1000, el diámetro es coorx

perímetro / diámetro pi enfoques para n grande

Labels: , , , ,