NXT serial number

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

NXT serial number

Post by mattallen37 »

Is it possible to have an NXC program be able to know what NXT it is running on by reading the serial number? In other words, is it possible to have an NXC program that displays the serial number of the NXT the program is running on?

Note, edited.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: NXT serial number

Post by aswin0 »

Hi,

I don't use Nxc so I can't give you any code. But each NXT has a "friendly" name that is displayed on the screen. This name is used in Bluetooth communication. You might check the manuals to see if you can access this name with NXC.

Aswin
My blog: nxttime.wordpress.com
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT serial number

Post by mattallen37 »

Well, I want access to the burned serial number (12 digit hex number), that way a program can tell the difference between any NXT, no matter what name you programmed it to have.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: NXT serial number

Post by schodet »

You can use GetBrickDataAddress.

Actually, this is the BlueTooth MAC address.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT serial number

Post by mattallen37 »

On your NXT go to Settings>NXT Version. What does that bottom line mean? It says "ID", and for the NXT I am using right now, the number is as follows "00165306A048", and that number is different on all my NXT's. Therefore it seems to be a burned serial number that was assigned to it by the Lego company when it was made, and is unique to this NXT. It is obviously read by the firmware, because it is possible to see it, but I want to access (read) that number in NXC programs.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Re: NXT serial number

Post by gloomyandy »

As reported above the "serial number"/ID you are seeing is actually the Bluetooth address of the NXT (obtained from the Bluetooth module). These addresses are unique to each Bluetooth device, so you can use it to identify particular NXTs...
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT serial number

Post by mattallen37 »

Oh, okay. Thanks. Can anyone tell me how to access that number in an NXC program then?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Re: NXT serial number

Post by gloomyandy »

They already have (two or so posts up), you use the GetBrickDataAddress function...
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT serial number

Post by mattallen37 »

Duh me, sorry. Anyhow, thanks all for your help. I'll test it now.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXT serial number

Post by mattallen37 »

Ok, I am having trouble. Can someone please post an NXC program to display the ID number?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests