Go to Post Like my programming class teacher has said multiple times: "Stop complaining on reddit about your code not compiling and actually fix it". - [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-06-2009, 22:25
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
VEX Defaut Code Dig Out Bitfields

So last night I downloaded the VEX default code library after finally finding it, because leaving it to WPILib was just too simple for me

So now I'm paying for it.

I have an old function from WPILib that I'm adapting to the default code, but since there are some implementation differences, I'm learning that it's not quite so straightforward to write portable functions for the default code. I'm trying to pass an argument to the function with the location of one analog input and two digital outputs. I have another function with 3 joystick ins and 3 PWM outs, and it works just fine with pointers. I define the argument as a pointer, and just use the & in front of the variable during the function call.

For this one however, it's not working anywhere near as easily. Putting a & in front of rc_ana_in01 brings up a syntax error, and doing the same for digital outputs (rc_dig_out11 and rc_dig_out12) gives me this error:

error: [1200] cannot reference the address of a bitfield

Alright, so I understand why the digital outputs are in a bitfield, that's fine. But first of all, I can't understand why the analog input can't just send it's address through, even though it's not defined as a bitfield, and why you have to cast it to a pointer to get the compiler to be quiet. Secondly, what would be a similar method of telling the function which digital outputs to use in a way that the function can directly control them?

If I can't do this, I guess that's alright, I just like being able to make portable functions because it makes it easier if I have to use them somewhere else, which I commonly do.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming The DS Dig. In? Big Kid NI LabVIEW 2 13-01-2009 09:42
Connecting custom sensor to RC dig I/O TubaMorg Sensors 10 16-04-2008 16:30
Code spitting out -16256? Bryan Herbst Programming 7 06-02-2008 18:41
First controller out of VEX kiettyyyy Electrical 0 05-11-2006 23:16
Check VEX out! Jon236 FIRST Tech Challenge 1 26-02-2005 13:39


All times are GMT -5. The time now is 01:11.

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