Page 1 of 4

NXT serial number

Posted: 03 Oct 2010, 20:09
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.

Re: NXT serial number

Posted: 03 Oct 2010, 20:58
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

Re: NXT serial number

Posted: 03 Oct 2010, 21:09
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.

Re: NXT serial number

Posted: 03 Oct 2010, 21:28
by schodet
You can use GetBrickDataAddress.

Actually, this is the BlueTooth MAC address.

Re: NXT serial number

Posted: 03 Oct 2010, 21:58
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.

Re: NXT serial number

Posted: 03 Oct 2010, 23:19
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...

Re: NXT serial number

Posted: 03 Oct 2010, 23:21
by mattallen37
Oh, okay. Thanks. Can anyone tell me how to access that number in an NXC program then?

Re: NXT serial number

Posted: 03 Oct 2010, 23:24
by gloomyandy
They already have (two or so posts up), you use the GetBrickDataAddress function...

Re: NXT serial number

Posted: 03 Oct 2010, 23:51
by mattallen37
Duh me, sorry. Anyhow, thanks all for your help. I'll test it now.

Re: NXT serial number

Posted: 04 Oct 2010, 00:03
by mattallen37
Ok, I am having trouble. Can someone please post an NXC program to display the ID number?