View unanswered posts | View active topics It is currently Sun Nov 23, 2014 8:12 am






Reply to topic  [ 7 posts ] 
Lego Brick Name 
Author Message
Rookie

Joined: Wed Jul 10, 2013 1:18 pm
Posts: 8
Post Lego Brick Name
Hello to all

I want to know if it is possible to change the name of the brick in RobotC using a code. And also it is possible to retrieve the name of the brick and display it on the screen.

thank you


Sun Jul 28, 2013 11:21 am
Profile
Rookie

Joined: Wed Jul 10, 2013 1:18 pm
Posts: 8
Post Re: Lego Brick Name
Is it possible to change the name and display it with RobotC ?
I need an answer for my project furtur.


Tue Jul 30, 2013 7:24 am
Profile
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Lego Brick Name
As far as I know, you cannot change the name of the brick with your code. There is a `kSizeOfBrickName` variable, but that is a constant 9 (8+1 termination character). And since you can't change the name of your brick while running a program, you might as well store it in a string and use it later. Is there something you are trying to do that necessitates this? If you explain your project, we might be able to help you.

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Tue Jul 30, 2013 3:40 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Lego Brick Name
The functions you are looking for are:

Code:
setFriendlyName(sFriendlyName);
getFriendlyName(sName);

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Jul 30, 2013 3:44 pm
Profile WWW
Professor
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 272
Location: Olympia, WA
Post Re: Lego Brick Name
Oops... That was in the Bluetooth section, wasn't it. :/

_________________
FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!


Tue Jul 30, 2013 6:08 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Lego Brick Name
Yep. :P

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue Jul 30, 2013 7:02 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3289
Location: Rotterdam, The Netherlands
Post Re: Lego Brick Name
The name of the brick is not kept on the brick itself. It's stored in the Bluecore chip and retrieved by the firmware. That's how it is able to persist between firmware upgrades and even when switching from the standard LEGO firmware to the ROBOTC one.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Jul 31, 2013 1:01 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.