Go to Post You are joining the greatest family in the world, FIRST, because we all strive to practice GP. - Ken Loyd [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-01-2015, 18:32
Darkseer54's Avatar
Darkseer54 Darkseer54 is offline
Former Controls Captain and Driver
AKA: Zach Kaplan
FRC #1086 (Blue Cheese)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2013
Location: Richmond, VA
Posts: 138
Darkseer54 is a glorious beacon of lightDarkseer54 is a glorious beacon of lightDarkseer54 is a glorious beacon of lightDarkseer54 is a glorious beacon of lightDarkseer54 is a glorious beacon of lightDarkseer54 is a glorious beacon of light
UINTs not working?

Hi! I am a programmer for team 1086, and we were trying to run last years code in eclipse. However, we have 76 errors worth of UINTs not work. Quick sample below of our drive motors. We used the UINTs for all solenoids and motors and sensors on the robot, and don't know why it isn't working in eclipse. Any assistance is thankful. We program in C++. The exact error is
Quote:
Type 'UINT32' could not be resolved
Thanks,
Zach


Quote:
//drive motors
static const UINT32 LEFT_FRONT = 1;
static const UINT32 LEFT_REAR = 2;
static const UINT32 RIGHT_FRONT = 3;
static const UINT32 RIGHT_REAR = 4;

Last edited by Darkseer54 : 13-01-2015 at 18:42.
  #2   Spotlight this post!  
Unread 13-01-2015, 18:41
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: UINTs not working?

We noticed this too when we copied in an old gamepad utility class. UINT32 and its ilk are not built-in C++ types; they're part of WPILib. If you dug around you might be able to find a file with "typedef UINT32 unsigned int" or something like that. As best I can tell, WPILib no longer uses the "UINT32" style of names for these types. Now they write them like "uint32_t", which is more typical style for naming custom types.

Technically speaking, C++ types such as "int" do not correspond to a specified amount of memory, although in practice int is always 32-bit. The WPILib people want a more a clear/unambiguous system, so they define their own type names, like UINT32 or uint32_t instead of "unsigned int".

There's no reason to use that in your code though; just replace all your UINT's with int or unsigned int. ctrl-f followed by "replace all" is how we did it.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)

Last edited by alopex_rex : 13-01-2015 at 18:50. Reason: edited for clarity
  #3   Spotlight this post!  
Unread 13-01-2015, 22:18
JohnSmooth42 JohnSmooth42 is offline
Is writing code
FRC #0375 (The Robotic Plague)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: New York
Posts: 27
JohnSmooth42 is an unknown quantity at this point
Re: UINTs not working?

Yeah we had the same problem too, Like another poster mentioned, you could just replace the values to unsigned int or include <cstdint> and change them all to uint32_t's if you really want that data type.
  #4   Spotlight this post!  
Unread 14-01-2015, 01:30
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 487
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: UINTs not working?

Quote:
Originally Posted by alopex_rex View Post
Technically speaking, C++ types such as "int" do not correspond to a specified amount of memory, although in practice int is always 32-bit.
Teams are likely to run into the basic Arduino boards which have 16 bit ints. And ILP64 (64 bits for int, long, and pointer) systems exist too, though they are more unusual.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi