View Single Post
  #2   Spotlight this post!  
Unread 19-01-2009, 16:11
Mike Mahar Mike Mahar is offline
Registered User
FRC #0138
 
Join Date: Jan 2007
Location: Amherst, NH
Posts: 64
Mike Mahar will become famous soon enough
Re: Potentiometer on cRIO, Programming in Windriver

I'm typing this in at home so it might have a few typos:

Code:
#include <AnalogChannel.h> // include all the AnalogChannel definitions

AnalogChannel  turretPosition * = new AnalogChannel(1) // declare a pointer to an Analog Channel and allocate a channel

float turretPosDumb;

turretPosDumb = turretPosition->GetVoltage();
The -> style of accessing a function tells the C++ compiler that you are using a pointer.
Reply With Quote