Embed
Email

Lego/Scheme

Document Sample
Lego/Scheme
Shared by: HC111214205458
Categories
Tags
Stats
views:
16
posted:
12/14/2011
language:
pages:
8
Lego/Scheme

By Rusty Burchfield and Brent Hepburn









LEGO name and Symbol are registered

trademarks of the LEGO Group.

Background

• Limited implementation of Scheme for the

standard firmware

• Developed at Indiana University by three

CS undergraduates

• Developed start to finish in three days









LEGO name and Symbol are registered

trademarks of the LEGO Group.

Environment

• Petite Chez Scheme 6.1

– LegoScheme compiler

– LegoScheme source

• Lego Mindcontrol

– Visual Basic output from LegoScheme









LEGO name and Symbol are registered

trademarks of the LEGO Group.

Features

• 10 concurrent tasks

• Support for most built-in scheme functions

• Support for lambda definitions

• Functions defined for direct interaction

with RCX









LEGO name and Symbol are registered

trademarks of the LEGO Group.

Limitations

• Requires Lego Mindcontrol

• Tail-recursive ONLY and without

parameters

• Limited support for bindings

• Only 8 functions

• Only 30 signed integers available

• Concurrency issues



LEGO name and Symbol are registered

trademarks of the LEGO Group.

Example

(define task_zero (define task_two

(lambda () (lambda ()

(setup-sensor 1 'reflection 'percent) (wait 500)

(set-engine-direction "02" 'forward) (flip-engine-direction "0")

(set-engine-speed "02" 4) (wait 200)

(set-engine-on/off "02" 'on) (flip-engine-direction "0")

(task_one) (wait 500)

(task_two) (flip-engine-direction "2")

(task_three))) (wait 200)

(flip-engine-direction "2")

(define task_one (task_two))

(lambda ()

(let ((x (read-from-sensor 0)) (y (read-from- (define task_three

sensor 2))) (lambda ()

(if (= x #t) (let ((z (read-from-sensor 1)))

(set-engine-on/off "02" 'off)) (if (> z 50) (play-system-sound 'fast-slide-

(if (= y #t) up) (task_three)))))

(flip-engine-direction "02"))

(task_one))))







LEGO name and Symbol are registered

trademarks of the LEGO Group.

Conclusion

• Difficult to use

– Many restrictions

– Hard to setup

• Lacking the power of Scheme









LEGO name and Symbol are registered

trademarks of the LEGO Group.

Resources

• References

– http://www.cs.indiana.edu/~mtwagner/legosch

eme/

– http://home.zonnet.nl/ericbrok/legomind/proje

cts/robo/mindcontrol.htm

• More Information

– http://www.cs.rit.edu/~bah5108/







LEGO name and Symbol are registered

trademarks of the LEGO Group.


Related docs
Other docs by HC111214205458
INTER SWISS
Views: 4  |  Downloads: 0
FUMIGACIONES D�ANGELI
Views: 1  |  Downloads: 0
Building Block Implementation
Views: 2  |  Downloads: 0
PowerPoint Presentation - Diapositiva 1
Views: 1  |  Downloads: 0
Application
Views: 0  |  Downloads: 0
Formulario 1
Views: 2  |  Downloads: 0
REP�BLICA DE COLOMBIA
Views: 0  |  Downloads: 0
Las causas del desempleo
Views: 5  |  Downloads: 0
91030 Apply measurement in solving problems
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!