On Sat, Oct 6, 2012 at 1:27 AM, Alan Jhonn Aguiar Schwyn
<[email protected]> wrote:
> 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, maybe
> there 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 port
> where 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, which
> brick get the next functions.
> The important of this change: when you have only 1 brick, the code no have
> changes!
>
> Opinions?
>
> Regards!
>
> Alan
>
> ________________________________
> From: [email protected]
> Date: Fri, 5 Oct 2012 14:45:48 -0400
> To: [email protected]
> CC: [email protected]; [email protected]; [email protected]
>
> 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 <[email protected]>
> wrote:
>
> On Fri, Oct 5, 2012 at 2:30 PM, Dr. Gerald Ardito
> <[email protected]> wrote:
>> Walter,
>
>> 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
> more dynamic.
>
> -walter
>
> --
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
>
>
>
> _______________________________________________ IAEP -- It's An Education
> Project (not a laptop project!) [email protected]
> http://lists.sugarlabs.org/listinfo/iaep

Attached is a BETA version of a new WeDo plugin that supports multiple
devices. It follows a schema similar to what Alan proposes above. I
only have one device, so it is not tested for multiple devices,
however, it seems to work for one device and includes a new feature
which tests for devices before each start, rather than just at launch,
so devices and be plugged in and unplugged without having to restart
Turtle Art.

Feedback greatly appreciated.

regards.

-walter

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org

Attachment: wedo.tar.gz
Description: GNU Zip compressed data

_______________________________________________
IAEP -- It's An Education Project (not a laptop project!)
[email protected]
http://lists.sugarlabs.org/listinfo/iaep

Reply via email to