[IAEP] Turtle Blocks question
Alan Jhonn Aguiar Schwyn
alanjas at hotmail.com
Sat Oct 6 01:27:43 EDT 2012
I think that you cannot check what sensor is connected..Butia have hotplug and show instantly that a sensor is connect.Lego not have that, and the only check possible: get a value, if no gives errors, maybethere are a sensor of that type connected..
>The usual approach would be to add a device input to the blocks...>device 1, device 2, device 3
That can works, but I don't like it taking into consideration that you have put the portwhere each sensor/motor is connected.
I think in a special block that sets the brick that you want to use.For example:- you have 2 bricks connected-if you want to: read color sensor from brick 1 in port 1-turn motor in port b of brcik 2 with power 100 The code will be:
select brick (1)read sensor (color, port 1)select brcik (2)turn motor (port b, 100)
See that all the blocks no have changes, only uses the "select brick" to set in the system, whichbrick get the next functions.The important of this change: when you have only 1 brick, the code no have changes!
From: gerald.ardito at gmail.com
Date: Fri, 5 Oct 2012 14:45:48 -0400
To: walter.bender at gmail.com
CC: alanjas at hotmail.com; iaep at lists.sugarlabs.org; support-gang at laptop.org
Subject: Re: [IAEP] Turtle Blocks question
Walter,Agreed.I am happy to continuing working with you on this.Gerald
On Fri, Oct 5, 2012 at 2:36 PM, Walter Bender <walter.bender at gmail.com> wrote:
On Fri, Oct 5, 2012 at 2:30 PM, Dr. Gerald Ardito
<gerald.ardito at gmail.com> wrote:
> if we are crossing devices?
Egon Spengler: Don't cross the streams.
The usual approach would be to add a device input to the blocks...
device 1, device 2, device 3... But also, I should do a better job of
autodetecting which sensors are available. The whole thing should be
IAEP -- It's An Education Project (not a laptop project!)
IAEP at lists.sugarlabs.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IAEP