Unique Id of brain

Hi, does anyone know how to get the V5 brain unique ID inside the programs. Each v5 brain has its unique ID and a team name. How can we get these information inside the vexcode pro. Thanks!!!

A place to look is the API site for VEXCode Pro
https://api.vexcode.cloud/v5/abstract/class/classvex_1_1brain

I have not hunted down the specific functionality you are seeking.

It may be a private API - jpearman can clarify.

and Welcome to VEXForum!

2 Likes

Some additional context might be helpful – what are you doing that you want to get the team number associated with the brain?

You could just #define it at the top of the file:

#define TEAM_NUM "1234A"
#define TEAM_NAME "My Team Name"
2 Likes

Yes, I know. I just make an example. The point is I want to get the information that vex automatically generated. Not just team number, but also device serial number, vex brain unique ID and so on. For example, event log stores the status of your robot, but I definitely cannot predict what event will happen in the future and define it in the program, this is impossible.

Well, personally, on the other hand, I think no one will use the event log in the programming. Haha.

But for now, i just focus on the unique ID of
the brain.

Thanks for your reply anyway.

1 Like

Yeah, api doesn’t have this. I know. :joy:.
Maybe vex brain have an address to store this information. Jpearman may know it.

And thank you to welcome me. :smiley:

I see the use case for this - you are a team with building multiple versions of the robot - you want to make that the code is run on the correct hardware instantiation.

Brain UniqueID would be useful for this.

4 Likes

Yes,just like what you said,this is a good method to separate different brain. We can use this in a lot of situations. For example,some brains may suffer some damage after competition. So program may automatically detect whether the brain id can be found in a set of broken brain id collection. Then output and print a warning on the screen,or do even more logical reaction to this brain. It can prevent people to use this broken brain again.

Well,i know that someone may just say why dont you just use pen to make a signal. Then you know this is a broken brain. But anyway,unique id is useful in a lot of situations.

1 Like

And is that possible to get unique id in programming?I think the answer is yes.


here,you can see the id inside the v5 code pro device information. So if vex code itself can automatically detect the id,there must be somewhere to output this ID. Maybe an address in the brain, maybe an algorithm to detect it and you can utilize it like other v5 function.

And,furthermore,how do i get other vex automatically information?

So these kinds of problems have bothered me for a long time,and no such kind of questions been asked before in the vexforum,also cannot find some useful information in Google.

Finally, i decided to create an account to ask this. Hope anyone may have some ideas to this. :smiley:

1 Like

There is no API to read the brain unique id in user code. I can consider adding for the future, but that won’t be any time soon.

4 Likes

Ok…… :confounded:
(Maybe have an address inside the brain to get this?)

In the meantime, silver sharpie is your friend - write what is broken on the V5 brain:

  • smart ports
  • USB port
    etc…
    works well.
3 Likes