Boreatton Scouts
Posts: 34
Joined: Sat Apr 14, 2012 3:00 pm
Contact: Website

Re: Lego

Sun May 06, 2012 9:59 pm

Fed up of only posting to troubleshooting so thought I'd post here too! We got wifi working through powered hubs (takes a few boots but gets there reliably, and once it works it keeps on working ) so thought we'd see what we could do!

The scouts have now made a couple of games in scratch and now have to be dragged away by parents and we got BT working just following the debian bluetoothuser page. That means we can connect to our Lego NXT robot (which won the UK FLL robot design prize ! ) and then today got nxt-python which allows simple python programs to run and drive the NXT around using the python editor shipped on the standard distribution. Had to install python-bluez too as per the nxt-python installation page instructions, but all worked out of the box! Driving our robot around by RPi and Bluetooth!

Next job is to get mind controll working! We've downloaded Puzzlebox Brainstorms, which crashes trying to load Qt stuff from Pyside (to get Qt4). Any ideas where Qtcore etc are? had a brief hunt but the Pi is q slow... and then the family wanted the TV. I'm hoping that Pyside is all in Qt5 nd on the standard release somewhere...

Only problem is that with BT on one powered hub, the keyboard and mouse on the other powered hub will only work one at a time (mouse or keyboard but not both... Oh well can't have everything all at once I guess )

Al

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Lego

Sun May 06, 2012 10:41 pm

We still have a lot of critics who tell us that we're barking up the wrong tree: kids, they say, don't want to program.

I'm glad that neither we nor your scouts appear to have got that memo.
Director of Communications, Raspberry Pi

Joefish
Posts: 95
Joined: Wed Jan 25, 2012 10:31 am

Re: Lego

Sun May 06, 2012 11:08 pm

That reminds me - Liz - this is the guy that manufactures his own add-ons for LEGO Mindstorms.

http://www.hitechnic.com/home

And this is LEGO's 'Power Functions' page about the modular battery / motor / IR-control system they've introduced in recent years.  All their Technic and trains are now based on this system.

http://powerfunctions.lego.com.....fault.aspx

Although surprisingly, they don't yet link the PF kit with Mindstorms NXT.  They do have an educational kit called 'WeDo', aimed at the higher primary age group, which is a way of driving a motor and a touch switch from a puck plugged into a USB port.  WeDo is also compatible with Scratch.

http://education.lego.com/en-g...../products/

So being able to drive the motors from the Pi could open up quite a few projects.  It seems to make sense to me to use the PF connectors rather than the NXT ones, but I don't know if John can get hold of those in bulk.  I shall have to ask.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Lego

Sun May 06, 2012 11:38 pm

Aha - thanks! (Joefish and I were just talking about this earlier today.) I'll look into it in the morning.
Director of Communications, Raspberry Pi

Boreatton Scouts
Posts: 34
Joined: Sat Apr 14, 2012 3:00 pm
Contact: Website

Re: Lego

Mon May 07, 2012 8:28 am

Lego are a bit frustrating in not joining things up so you have to buy different kits each time

The scatch environment is nice and a couple of the scouts who hve avoided the NXT G environment were quite happily doing things in scratch, so integrating the two might be fun.

http://enchanting.robotclub.ab.....-index.php

looks like it might be a way to look like scratch but use the expensive lego we already have rather than invest in the wedo kit

cashaw
Posts: 71
Joined: Tue Mar 06, 2012 8:32 pm

Re: Lego

Mon May 07, 2012 8:50 am

liz said:


We still have a lot of critics who tell us that we"re barking up the wrong tree: kids, they say, don"t want to program.

I"m glad that neither we nor your scouts appear to have got that memo.


Those comments always remind me about the nah-sayers who predicted that the general population would never be able to drive automobiles as they were far too complicated. Or why would the average Joe ever want a computer in their home ?

I grew up in the early 80's home computer boom and accepted computers for what they were, I never questioned on why I needed to program the thing, it was just one of those things you needed to do and I quite enjoyed it. In fact the eventual packaged solution for the home user called Windows put me off programming as it always seemed far too complicated and you could no longer just switch on the computer and get programming.

I always laugh that my father still struggles away with his home accounting package, originally written in BBC Basic, then converted to GW Basic and then Quick Basic. He always has problems whenever he is forced to upgrade his Windows system and get a compatible version of QB to run. He still thinks of me as a computer wizz which I may have been in the BBC-B days, but I am as lost as he is on how to make or change anything on modern Windows systems.

Joefish
Posts: 95
Joined: Wed Jan 25, 2012 10:31 am

Re: Lego

Tue May 08, 2012 10:26 am

There is one nice compatibility with the Power Functions system, on the extension leads.  The bricks on the ends have connectors top and bottom, but if they all connected to the PF system you could short out batteries, motors etc.  So the underside of one end of the extension lead is actually a fit to the old style of 9V connections, so motors, train motors and lights from the last 20 years can be connected too.  The PF system is very clever at mechanically locking out any possibility of short-circuits.

It also lets you daisy-chain one of the old train controllers onto a new (empty! - very important that) technic battery box, which when you switch on, powers up the whole PF system so you can run it all from the mains, and without that annoying 2-hour cut-out that's now built into the Li-Ion and AAA battery boxes.

But with Mindstorms, they've partnered with these guys who've designed their own sensor add-ons to supply them with the cases and connectors, and re-sell some items in their own on-line shop.

They did produce a pack of adaptors that go from NXT motor outputs to the old 9V connectors.  I have a few of these precious things; they needed a downloadable extension to the NXT-G language to operate.  Unfortunately they haven't replaced these with a version for PF motors.

I'm not sure if they're relying on these other parties to develop the adaptors, or even if they're able to supply them with the new PF power connector bricks.  It may be that it's not easy for anyone else to assemble them as they're based on 4-core cables, not 2 like the old ones.

You could make your own by buying a PF cable and a NXT cable, cutting both in half and wiring the relevant cores together.  But an official one would be better.

Until then, there's an opportunity for the Pi to become the de-facto sequencing controller for Power Functions...

specsdude
Posts: 52
Joined: Sat Jan 21, 2012 2:15 pm
Location: In a small English village, far from the eyes of Mordor

Re: Lego

Tue May 08, 2012 3:56 pm

Hey people!

Nice to hear you've got your Pi! This is an area that I'm also interested in- do you know how easy it would be to use the Pi as a controller, wired up to PF components and/or NXT sensors? Maybe using Scratch as the software side?

This is my plan for the Raspberry Pi, still doing research and you guys sound like you know what you're up to.

Any help or info would be great,

Dave
Arise! Arise, riders of Théoden! Spears shall be shaken, shields shall be splintered - a sword day, a red day, ere the sun rises! Ride now! Ride now! Ride! Ride to ruin, and the world's ending! Forth Éorlingas!

Joefish
Posts: 95
Joined: Wed Jan 25, 2012 10:31 am

Re: Lego

Wed May 09, 2012 3:10 pm

Come to think of it, all that's really needed is an IR transmitter (and/or receiver) that can be plugged onto the GPIO, like older phones and iPAQs.  You'd need a separate power supply for the motors anyway, so why not use the existing IR system as your opto-isolator?

The protocol that LEGO use to control the PF IR receiver has been published (fandom pressure again).  It even includes some direct control modes that their own remotes aren't able to transmit.  There's even a code (based on some input of mine, actually </smug mode>) that you can send that locks out receiving standard commands so you can't be interfered with from a standard shop-bought remote.

Joefish
Posts: 95
Joined: Wed Jan 25, 2012 10:31 am

Re: Lego

Mon May 14, 2012 12:10 pm

I've just had a response from John Barnes at HiTechnic. Although he said it sounded an interesting project, he couldn't forsee sufficient demand to make it worth the production costs of a new device. Here's hoping we can demonstrate otherwise once the Pi really gets into its stride production-wise.

In the meantime, the 'RasPi as universal Remote' thread offers an interesting alternative - using a simple IR emitter plugged into the audio port and playing back sampled control codes. Though it would probably need to be able to dynamically generate samples on-demand to cover all the codes of LEGO's PF IR control system. And to be able to emit them via GPIO rather than audio out would also be preferable.

Return to “Staffroom, classroom and projects”