Tuesday, January 24, 2012

Wedo plugin for Turtle Art


Download here a plugin for TurtleBlocks V131 (tested on OS880 Sugar 0.94) . It is a rework of a project by I.T. Daniher which has been dormant since March 2011. Here and here.

Download the file and unzip it, copy wedo-plugin to the plugins directory of Turtle Blocks (/home/olpc/Activities/TurtleArt.activity/plugins).


Known problems:
Turtle Blocks will not start unless a Wedo is connected
The distance sensor gives bad values if the motor is running

Labels: , , , , ,

Saturday, January 21, 2012

Arduino and the XO laptop


The Freetronics Leostick is a low cost Arduino board. (It is presumed to be low cost, it was cheap enough to place into the satchels of the attendees of LCA2012.) The XO-1.5 already has 2 channel analogue input, an Arduino board can add a lot of extra input and output channels.

This could facilitate a number of low cost science and robotics experiments in schools, experiments at a cost suitable for developed and even developing countries.


There are a number of ways such a board could be used:
  • from the Arduino IDE
  • from TurtleArt, Firmata running on the Arduino
The second version is probably the most practical for classroom use. Once the Leosticks are loaded with Firmata (and this could even be at the factory) all that is requited is TurtleArt drag and drop programming.

Installing the Arduino IDE onto a XO-1.5 laptop (OS880)
In terminal enter the following

sudo yum install arduino

This installs an older version (0021), more importantly it installs all the dependencies including Java and avr-gcc. It is a 60MB download which expands to 200MB of storage, be warned it uses up a lot of precious space.


The IDE can be started from the Gnome menu or with the command

arduino

but it does not have the permissions to see the Arduino board on the USB serial port so start it as root (maybe why)

sudo arduino

The IDE can then be upgraded to version 1.0. This is the version recommended for the Leostick. Download version1.0 from http://www.arduino.cc/en/Main/Software
The file arduino-1.0-linux.tgz uncompresses with the Gnome archive manager. Uncompress it to a convenient location, if for example if you uncompress it to Documents, you will find a directory arduino-1.0 in this directory.

You now have 2 versions of the program, 1.0 (at /home/olpc/Documents/arduino-1.0 ) and 0021 (with components at /usr/share/doc/arduino-0021 and /usr/bin). The later versions 1.0 uses the dependencies installed with the earlier one 0021.

As described at http://www.freetronics.com/pages/leostick-quickstart-guide uncomment the following lines in /home/olpc/Documents/arduino-1.0/hardware/arduino/boards.txt

(or in version 0021 you would need to add them)

leonardo.name=Arduino Leonardo
leonardo.upload.protocol=arduino
leonardo.upload.maximum_size=28672
leonardo.upload.speed=1200
leonardo.bootloader.low_fuses=0xde
leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xcb
leonardo.bootloader.path=diskloader
leonardo.bootloader.file=DiskLoader-Leonardo.hex
leonardo.bootloader.unlock_bits=0x3F
leonardo.bootloader.lock_bits=0x2F
leonardo.build.mcu=atmega32u4
leonardo.build.f_cpu=16000000L
leonardo.build.core=arduino
leonardo.build.variant=leonardo

Launch the Arduino IDE (sudo /home/olpc/Documents/arduino-1.0/arduino), and select Tools > Board > Arduino Leonardo.
to select the Leonardo hardware

select Tools > Serial Port
a new device appears with Leostick plugged in, dev/ttyACM0, select it.

You can now upload example programs, eg blink, to the Leostick.

NOTE: this will overwrite the program that came with your Leostick that plays a tune, watch
http://forum.freetronics.com/viewtopic.php?f=27&t=167
for the original program


Controlling the Arduino with Turtle Art
Load Firmata software into the Leostick, this can be done on an OLPC, another Linux PC or Windows. Once this is done the Leostick can be used as a I/O expander for Turtle Block drag and drop programming. No Terminal or Gnome work would be needed.

http://tonyforster.blogspot.com/2010/10/arduino-fork-of-turtle-art.html

The version here works for older Arduino boards on Sugar 0.88 It needs patching at TurtleArtActivity.py, line 834 as described in the link above. The baud rates of Turtle Art and Firmata need to be patched.

Sugar 0.88 (Fedora 11) recognises an older Arduino board as as serial device but not the Leostick. Later Arduino boards are dev/ttyACM0

This version is hard coded to dev/ttyACM0, that means it only works the first time the Leostick is plugged in and not at all for older Arduino boards. It is patched and works on Sugar 0.94.

The quick and dirty patches are:
Turtleartactivity line 835
self.palette_buttons[i].set_tooltip('thing')
line 868 commented out
# palette_toolbar_button.set_expanded(True)
serialposix.py line 273
# self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
self.fd = os.open('/dev/ttyACM0', os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)



see also:
http://tonyforster.blogspot.com/2010/10/turtle-arduino-display-inputs.html
http://tonyforster.blogspot.com/2010/10/turtle-arduino-digital-write.html

Labels: , , ,

Sunday, February 14, 2010

Turtle Art - collapsed stacks and numeric input

Turtle Art now has the ability to collapse a stack of blocks, shown expanded above and collapsed below.
That, along with copy and paste, allows you to develop a handy set of stacks, like subroutines, for later reuse, which do not complicate program readability or use screen space.

The stack above captures a multi digit integer from the keyboard and returns with it in Box1 when enter is pressed. The digits 0-9 have a key value of 48 to 57. The enter key has a value of 13.

Turtle_Art_getnumber.ta


En español
septiembre 2010

Turtle Art tiene ahora la posibilidad de contraer una pila de bloques, que se muestra ampliada por encima y por debajo se derrumbó.

Eso, junto con copiar y pegar, le permite desarrollar un conjunto útil de las pilas, como subrutinas, para su uso posterior, que no se complican la legibilidad del programa o espacio en la pantalla uso.

La pila por encima de captura un número entero de varios dígitos desde el teclado y vuelve con él en el Cuadro n º 1 cuando se pulsa ENTER. Los dígitos 0-9 tiene un valor de clave de 48 a 57. La tecla Enter tiene un valor de 13.

Labels: , ,

Sunday, February 07, 2010

Turtle Art - higher ceiling


A good learning environment for self-directed learning has a low entry, wide walls and high ceiling. That is, it is easy for beginners, can facilitate a wide range of creative efforts and is unrestricted in top end complexity.

Turtle Art for the Sugar operating system started out as a nice little, Logo like, drawing package
for young learners. Its Turtle and Pen pallets allowed young learners to draw geometric shapes, solve problems and learn a bit about geometry and logic.

Its Scratch like interlocking program blocks made programming foolproof.

Maybe a year ago, Walter Bender introduced the Portfolio pallet, which allows the integration of multimedia into this simple programming language. This extended the use of Turtle Art into literacy activities.

Python programmable blocks were also added, this extended the ceiling, there was no effective limit to the top end functionality. There is however a big leap from drag and drop progam blocks to object oriented Python which limits the usefulness of these blocks.

Recently Walter and Raúl Gutiérrez Segalés have done a major rewrite of Turtle Art, the pre-release version (at the time of writing), version 83 is here. Variable names and block stack (subroutine) names are now themselves variables. These variables can be numeric or string and the + operator can concatenate both data types. This greatly increases the power of Turtle Art while staying with familiar drag and drop block programming.

The program shown above above creates a 10x10 array of variables. The variable "index" contains a string RnCm where n and m are the row and column. The variable "index" is used to name 100 variables named R1C1 to R10C10 which have the value Row x Column stored in them.

A variable "subroutine" or stack name is also used. On the first pass, "runarray" calls stack "doit" to create the array and initialise the array values on the second pass it calls stack "printit" to display the array values.

Now a wide range of sophisticated programming is possible. For example, Turtle Art could compute fractals but the slow execution of the underling Python interpreted language is a major limitation.

Labels: , , ,

Thursday, May 21, 2009

Problem visualisation in mathematics and programming


I have been researching into problem visualisation in mathematics and programming following a discussion, originally by Mark Guzdial and continued by Bill Kerr Alan Kay and others and also the parallel discussion by Rob Costello

One paper that has me thinking is the influence of texts' mental images upon problems' resolutions by Giorgio Bagni (2000). It examines the importance of the level of detail of the mental models constructed by students. Bagni asks whether imagining a situation in all its details helps problem solving. Bagni suggests that it can be an obstacle.

Problems were given to 3 Italian school classes, (13-14 years), (14-15 years) and (15-16years).

The first version was briefly stated as an abstract mathematical problem:

The length of the basis AB of an isosceles triangle ABN is 1 000 000 m; the sum of its sides AN, BN is 1 000 001 m; find the length of the height NM.

The second version was embedded in a real world context and included a diagram:

Let us tie a row to two nails very far, say… 1000 km; let us imagine to use a row whose length is exactly 1000 km: so this row will be tight. Then let us tie to the same nails another row, whose length is 1000 km and 1 m; so this second row is a bit longer than the distance between the nails and it will not be tight: in order to stretch it, let us bring the second row in its middle point and let us “raise” such point (see the picture), in order to take it away from the first row, until the second row is completely tight.

a diagram was shown followed by more text

Well, how much must we take away the middle point of the second row? Find the distance between the middle point of the first row, M, and the middle point of the second row, N.

I am hoping that the second version has suffered in the translation from the original Italian to English because it does not read well in English.

Finally the students were shown the correct solution by Pythagoras' theorem which has the result, which may be surprising at first, that by allowing a 1 metre increase in total path length, it is possible to deviate sideways by over 700 metres.

The students in the first group, those given the abstract problem, did significantly better than the second group with the real world problem.

When shown the correct solution, many in the second group, the group that had the problem given in a real world context, had difficulty accepting the correctness of the solution because it was counter intuitive that a such a small increase in total path length would allow such a disproportionately large sideways displacement.

Bagni concludes: “that D’Amore (1997) clearly proved that the full possibility to imagine a situation does not help pupils; now we state that, sometimes, this full possibility can constitute an obstacle to the resolution (or, as in the examined case, to the acceptation of the correct resolution)”.

I hear echoes of Cognitive Load Theory here. The idea that if you are teaching Pythagoras, you should remove any distractors from Pythagoras, so as to minimise the cognitive load on the learner. The learner can then focus their limited processing powers on the material which is to be learnt.

My thought is that the cognitive conflict created by the second problem is valuable for learning and that students should be given time to experience and resolve such cognitive conflict if they are to have more than a superficial understanding of a subject.

This particular cognitive conflict relates to deeper understanding of geometry and physics. It is closely related to the concepts that:

For small x, sin(x) = x.

Over a given distance, the tangent is very close to the circumference if the circle origin is remote.

At x=0, the derivative of sin(x) is maximum but the derivative of cos(x) is zero.

Why is it increasingly hard to pull a rope span, a catenary, the closer to straight it gets? Because your mechanical advantage tends to 1/infinity. Which group of students would you rather have specifying the support structure for electricity cables crossing a busy road?

Jonassen talks of schooling to create real world problem solvers. In school you know that you are doing Pythagoras this week so any problem you are given will be solved in a similar way. Real world problems are poorly specified and multi disciplinary, they require students to have engaged in messy problems.

Labels: , ,

Saturday, March 21, 2009

Turtle Fileview

A fileviewer for Turtle Art using the programmable Python brick

The Python brick code
def myblock(lc,x):
text=lc.heap.pop(-1)
if x==0:
dialog = gtk.FileChooserDialog("Load...", None, \
gtk.FILE_CHOOSER_ACTION_OPEN, \
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
dialog.set_default_response(gtk.RESPONSE_OK)
fname = None
response = dialog.run()
if response == gtk.RESPONSE_OK:
fname = dialog.get_filename()
dialog.destroy()
f = open(fname, "r")
f.seek(0)
text = f.read()
f.close()
text="".join([z for z in text if ord(z)>0])
lc.heap.append(text)
lc.heap.append(text[int(x*500):int((x+1)*500)])
The file selection dialog box


Output screen, viewing a py file

Labels: , ,

Sunday, March 15, 2009

Turtle Oscilloscope


For the experimental Turtle Art Portfolio V18 for the XO hardware, this program uses the programmable brick and sensor input . (As at V19 Turtle Art Portfolio, the 2 imports below are no longer required.) (As at V44 of Turtle Art, the programmable block is supported but sensor input still is not.)


# Oscilloscope
# Tony Forster, March 2009
#

from taturtle import *
from math import *
def myblock(lc,x): # x is volts input
ox=lc.tw.turtle.xcor #old x coordinate
oy=lc.tw.turtle.ycor #old y coordinate
nx=ox + 1 #new x coordinate
ny= x #new y coordinate
setxy(lc.tw.turtle, nx, ny) #jump to new coord.
draw_line(lc.tw.turtle,ox,oy,nx,ny)
return

A better oscilloscope

Labels: , , , ,

Sunday, March 08, 2009

One Player Pong for TurtleArt

For the experimental fork of TurtleArt V18

Move the bat with the A and D keys
Issues:
Slow execution speed
Running out of canvas for the blocks

Labels: , , ,

Monday, March 02, 2009

OLPC language localisation


image from http://wiki.laptop.org/go/Image:P1020317-1.JPG

One of the strengths of the OLPC is its philosophy of the child being "not just a passive consumer of knowledge, but an active participant in a learning community" and so the software was designed with "no inherent external dependency in being able to localize software into their language".

Language localisation of software
It seems that language localisation of the software would be a good learning project for children, it would give them a relevant and authentic project which I would expect to be highly motivating. I would expect it to be quite challenging for them and require a deep understanding of language and of the subject that the language was describing.

I found the Wiki of the Bering Strait School District inspiring with wiki dictionaries of the Inupiaq and Yupik languages which could be edited by teachers and students. Students could use a similar process to localise the OLPC software into their own language.

Localising Speak text to speech
An activity which the students apparently enjoy is Speak , a text to speech synthesiser. I tried to reproduce the process of editing the language dictionary described in the instructions on laptop.org and to provide more detail so that students could follow the instructions and localise Speak for their language.

I found the process quite difficult, largely due to the file management provided by the Journal. You can find the steps I followed here.

What was difficult:
Zip files can only be unzipped by Etoys
Etoys will not unzip to the Journal
Etoys has limited file privileges, I ended up unzipping to a temporary file in an obscure location
Transferring to the Journal requires Linux directory navigation and understanding of Mime
I was unable to transfer from the Journal to the target directory because of root user issues
The Journal added a .txt extension that had to be removed
copy to and from journal are poorly documented and complex

An operating system for children is ideally low entry, high ceiling and wide walls. That is it should be easy for children to start with, have a well graded pathway to very complex functions and it should allow children to do anything, including things that we could never anticipate.

I am trying to get to like the Journal and Browse but its not easy.

Labels: , ,

Friday, October 03, 2008

Which Programming Language Makes it Easier for Students to Learn to Program?

In an interesting presentation at ACEC2008, Jason Zagami presents the results of a study, Which Programming Language Makes it Easier for Students to Learn to Program?

Jason tests text only languages, PHP and VB, mixed text/graphics languages Game Maker and Alice and a graphics only language Robolab (Labview) .

The languages were tested in an Australian girls' secondary school. The difficulty reaching levels of competency in programming language structures such as simple sequencing and nested loops was compared.

"programming languages that rely predominantly on visual representations were shown to be more effective in supporting student understanding of introductory programming concepts than programming languages relying predominately on text"

If I understood his presentation, he further indicated that mixed text/graphics languages were better for simple concepts like sequencing but text only or graphics only was better for more difficult concepts like nested loops.

I look forward to reading the wider study when it is published: Zagami, J. (2008). Seeing is understanding: The effect of visualisation in understanding programming concepts. (Doctoral dissertation, Queensland University of Technology, 2008). Dissertation.

Labels: , ,

Thursday, September 04, 2008

Bioware, creators of Neverwinter Nights have announced the Dragon Age™ Toolset. It looks like it will allow students to create computer games similarly to Neverwinter Nights.

The following quoted from their web site :
  • Create Original Adventures – Using the rich set of Dragon Age assets and locations as starting blocks, users can modify these stunning areas by adding new quests, characters and scripting to craft their own adventures, fate–defining conversations and cut–scenes.
  • Powerful Script Editor – Users can fully customize combat and creature AI, allowing them to create detailed action sequences full of heart-pounding party–based tactical combat.
  • Content Creators Community – BioWare plans to have a dedicated community area online where content creators can share content easily and get content updates for the toolset.
  • On–Going Toolset Content Updates – BioWare plans to release additional assets and features for the toolset in the future, allowing for expanded creation of new areas.

BioWare has a long history of delivering powerful content–creation toolsand support to its community. In 2002, the studio released a Toolkit for the ever popular Neverwinter Nights™ which has allowed fans to create over 5,000 adventure modules of their own design, the most fan-created content in BioWare's history. Fans have not only created stand-alone adventures with the trailblazing Neverwinter Nights toolset, they still continue to create modules, five years after its original release and have crafted thousands of completely new monsters, hundreds of thousands of in–game objects (eg. weapons, armor, food, special effects, building facades, etc.) and dozens of worlds.

For more information about Dragon Age™: Origins, the latest updates, or to join BioWare's Dragon Age community, visit www.dragonage.com

Labels: , , ,

Thursday, February 01, 2007

Game programming tools

I think the essential features for game programming languages for school use are:

  • easy entry level programming with drag and drop programming
  • a true versatile programming environment, not just selecting from limited scenarios
  • top end extensibility through fully featured text based programming
  • licencing which allows kids to continue to work at home for free

Running through the products with an apology for any errors and omissions, sorry limited time may mean errors:

Game Maker - meets all criteria, unregistered version is free
Click&Play - "free for schools" puts home use in doubt, one of Clickteams old products
Multimedia Fusion 2 by Clickteam, built on Click&Play?
Stagecast - US$49.95
Games Factory - price $? by Clickteam
Alice - free, 3D but limited scenarios?
Python - free, opensource, text based
Blender - free, opensource, complicated
Dark Basic - text based
Bliz Basic - text based £30 - £50 per copy
KPL - free, text based
Logo - text based
Flash - text based, cost
Toontalk - US$25
Squeak - free, opensource, not that easy bottom end?
Etoys - written in Squeak
Scratch - Scratch is written in Squeak, Scratch uses graphical programming, open source but not open development, recommended yr1 to 6
Adventure Author - not yet available?
Runtime Revolution - £33 www.runrev.com
Mission Maker - £79
Baltie - US$18, can you make games? need to look into it further
Runbasic - text based? cost?
3D Gamemaker - limited scenarios? £10 - £25
Thinkingworlds - not easy entry?
Kahootz - not a programming tool, cost
Beyond Virtual - 3D, Starter free, Silver $150
RPG Maker - 30 day free trial, US$60 http://www.enterbrain.co.jp/tkool/RPG_XP/eng/
ADRIFT - Text Adventure creation program, registered version $18.95 www.adrift.org.uk/
Fablusi - online role play simulation platform http://www.fablusi.com/
Quest -
Make text adventures, role-playing games, training materials, simulations, interactive fiction, Trial version or $39.95, http://www.axeuk.com/quest/index.htm
Inform is a design system for interactive fiction, it is free and runs on Mac OS X and Windows
Realm Crafter - Massively Multi-Player Online Role-Playing Game Creation engine allows you to design, create and publish your very own MMORPG game
StarLogo TNG graphical programming, 3D, Win & Mac, free to schools
Sploder create fun flash games, Try the Game Creator Demo
Sludge make RPG's
Visionaire create your own adventure game, free version cannot compile standalone, registered version 20Euro
VastPark, free, a virtual worlds platform that lets anyone create their own virtual world
eMERGENCE, Flemish Ministery of Education, available soon?
DreamSpark, Microsoft Visual Studio 2005, and XNA GameStudio 2.0, available soon?
Neverwinter Nights Aurora Toolset, $20 3D quest game level editor
Phrogram trial version free, otherwise express $30, standard $50
SwinGame SDK http://www.swingame.com/2D. Supports Pascal, including FreePascal and Turbo Delphi, VB6, Visual C#, and Visual Basic .NET
Ren'Py visual novels dating sims and simple games
http://atmosphir.com/ Atmosphir free tool for platform games
Agent Sheets, free 10 day trial, AU$160, education edition AU$130, can save as Java applet and can export simulation statistics to spreadsheet. More on educational aspects at Scalable Game Design including lesson plans
TurtleArt, free, runs on the Sugar operating system or Gnome (Linux)
Game Editor, free and open source if your game is similarly licenced otherwise US$94.95
Kodu (originally named Boku) runs on Microsoft Windows and the Xbox 360
Unity inc. Wii and iphone, free lite version and 30 day trial pro version
PlayBasic Free version or $A29.49. The free version cannot make .exe , text based, mainly for 2D games, Windows
Panther - based on Scratch, many enhancements by some Scratch enthusiasts
Unreal Engine 3 development kit - UDK, free
Gamestar Mechanic Free and premium versions
http://gamesalad.com/ Mac, iphone, ipad. Free or $99 pro
Google appinventor for Android mobile phones. Scratch like block programming
Cryengine CryENGINE3 Educational SDK is for internal, non-commercial use; and is available only to educational institutions.
http://scripttd.codeplex.com/ ScriptTD is an open source tower defense game engine for Windows Phone that allows non-developers to create TD games by changing settings, sounds, and graphics.
Portal - incorporating Portal™ and Portal 2 into classrooms - looks like its 3D level editing

See also a list at http://www.ambrosine.com/resource.html

For an alternative view see
An Objective Comparison of Languages for Teaching Introductory Programming
which looks at programming, not game programmng
and
the importance of visual programming by Detha Elza
Lowering the Barriers to Programming: A Taxonomy of Programming Environments and Languages for Novice Programmers, Caitlin Kelleher and Randy Pausch, Carnegie Mellon University
http://www.gamedevelopertools.com

Scalable_Game_Design see p19 for criteria
Teach a Kid to Program

Labels: ,