Brick Labs

The Source for LEGO Robotics and Educational Materials

Brick Labs header image 1

NXT-G – Custom graphics for your MyBlocks

August 5th, 2010 · No Comments · Tutorials

Damien Kee posted a nice bit over at The NXT Step on how to setup custom graphics for your MyBlocks.

Damien has the full tutorial on how to do this on the NXT Step site…

→ No CommentsTags:·

The Robots are Coming!

July 27th, 2010 · No Comments · Building Techniques

Even the yellow ones…

Cool looking robot.  Called the HoverBot 3K.

Full building instructions included.

About two years after Sandro built the HoverBot 3K instructions are now available. Feel free to use them. We would be happy if you
posted a picture of your own HoverBot 3K.

Apparently, it was originally built by his 8 year old son, with no help from Dad.  Impressive!

It uses some neat building ideas, without using any headlight bricks too.

→ No CommentsTags:··

Released: 3rd Party ROBOTC Driver Suite V1.4

May 11th, 2010 · No Comments · News

v1.4 of the RobotC Driver Suite has been released. You can download it here: RobotC Driver Suite v1.4

Details of the release are found here at Xanders Blog.

I’m in the processing of trying it out, and working my way through some RobotC samples. Especially for using the HiTechnic Experimenters board.

→ No CommentsTags:···

Experimenters Kit – RobotC Example 3

May 4th, 2010 · No Comments · Tutorials

This example takes the project from Example 2, and replaces the potentiometer with a sound sensor from LEGO.

Here is the project (same exact one from the prior example).

Experiments-Kit-Project-2

And here is the robot with the attached sound sensor.  Please note… I’ve only put the sound sensor in this location since the robot isn’t actually driving.  If it was going to be driving, I’d probably not bother with the sound sensor.  They are notorious for picking up the sound of the motors.

JenToo-soundThis time, everything worked perfect.  The LEDs almost pulse in time to your speaking, which is a neat effect.

My son came in to see what was going on.  He near broke my eardrum trying to get a nice loud noise to spike the LEDs.  Loud claps less than 6 inches from your ear tend to hurt.

This project was a very simple one.  I didn’t have to do any debugging or tweaking, since it just worked.

Example 5 deals with a home-made light sensor.  Should be a good project for tomorrow.

→ No CommentsTags:··

Experimenters Kit – RobotC Example 2

May 4th, 2010 · 1 Comment · Tutorials

The second example in the Experimenters Kit takes 6 LEDs (2 green, 4 red) and a potentiometer.

Depending on the value you turn the potentiometer to, a different LED lights up.

Experiments-Kit-Project-2

Here is the 2nd project (completed).  The 4 LEDs are there.  The Experimenters kit ships with 2 Green and 4 Red LEDs.  So that’s why I have mixed colors.
The blue piece (above the first green LED) is the potentiometer.  You’ll want to use a small screwdriver to turn it.  It’s a fairly precise pot.  There are also 6 resistors (identical in value).  One for each LED.

JenTooBTW, here is the robot I used for these projects.  I know Brian will recognize it.  All three of my NXT’s were in use, so I just grabbed one to use.

I started playing with this one once it was built.  It seemed to work right off… except for one thing.  The last LED on the right never lit up.

So, I started debugging.  The NXT display shows the value of the pot at any given time.  So I started matching numbers up to what was in the code.

The last LED should light up if the value of the pot exceeds 511.  However, the pot never exceeds 511.  The highest I was seeing was like 508 or so.  Then it looped around into the negative.

So, I changed the code to make the last LED light up after 325.  And everything worked beautifully.

→ 1 CommentTags:···

RobotC – Mini Tutorial #1 – Displaying Battery Power

May 4th, 2010 · No Comments · Tutorials

Today, while trying to debug the Example 1 from the Experimenters kit, I thought I might be having battery issues.  So I wanted to see what the battery level was.

Being new to RobotC, I figured this might be a fun little mini-project (and I do mean mini) to tackle.

So, first thing I did, was start checking the functions and such in RobotC.  I found a neat value you can read.

nImmediateBatteryLevel

It returns an integer of the battery level.  If your battery level was 7.499, then this value returns 7499.

So I copied a line of code to display this value on the NXT, like this below:

nxtDisplayTextLine(1, "%d", nImmediateBatteryLevel);

Perfect!  But wasn’t quite satisfied.  I wanted to display this on the NXT with the decimal.  And a bit of text so I knew what the value was.

Well, with a bit of math, you can divide a integer by a factor of 10 to get a decimal.  Since I wanted 3 decimal places, I divided by 1000.  In order to do the division, you need to convert (or cast) the integer to a float.  So that’s where the (float) code comes in. I also found you can include plain text in the nxtDisplayTextLine() function, and it will display that.

So here is what I came up with.

nxtDisplayTextLine(1, "Battery: %.3f", (float)nImmediateBatteryLevel / 1000);

That code puts the word "Battery: 7.499" on Line 1 of the NXT screen.  The 7.499 is the actual battery value.  The %.3f means I want a value with 3 decimal places, of type Float.

For those of you with a C background, this is common knowledge.  For those with a Basic background, type conversions are usually automatically done for you.  In RobotC, you have to be explicit about it.

→ No CommentsTags:···