Go to Post It is usually the simple things that get you. - Andy Brockway [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-01-2009, 15:16
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Angry Potentiometer on cRIO, Programming in Windriver

I am having a problem getting my program to compile because I apparantly do not know the magic hieroglyphs to call the method/function whatever I want from the WPI library. I am a very old school programmer and this object oriented stuff just hurts my head. (I had just got decent enough to program in the old C environment before they threw everything away. I am a mentor so I have to try and understand this stuff before I can help the students)

I want to hook a 10 turn pot to Analog Channel 1 on the Analog Breakout board and then get the value of this pot from my C code. I have set up a new control called TurretPosition, such that:

TurretPosition = new AnalogChannel(1)

Now I want to set a float variable TurretPosDumb equal to the value of the pot. (in the old code it would have been from 0-255, but now I understand it to be -1 to 1) I have tried:

float TurretPosDumb;

TurretPosDumb = TurretPosition->GetVoltage;
TurretPosDumb = TurretPosition.GetVoltage;

and various other scenarios but I keep getting compile errors. I am a native Visual basic programmer and I do not know how to get the magic C symbol to do what I want. (All these ;, ->, . , {} and stuff just seem arbitrary) I have not had C classes, and I am learning by translation from the programming I know and looking at examples in the default codes. They thankfully gave me an example for all my Digital Inputs but I can't find an example for Analog on the cRIO side. (I figured out how to use pots on the Driver Station)

Could someone please give me an example of how to get the value of my pot from the robot. Thank you. (Bare with us old fogeys that are used to just programming in a straight line and having stuff work)
Reply With Quote
 


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
Running the Motors Backward in WindRiver & cRIO Freezes kyungjin C/C++ 15 08-02-2009 14:24
WindRiver Programming dnrobotics11 C/C++ 4 19-01-2009 19:43
Getting Familiar with Programming in WindRiver kyungjin C/C++ 35 17-01-2009 13:04
CRIO not working with Windriver dpeterson3 C/C++ 7 07-01-2009 20:49
potentiometer programming help Chris1228 Programming 2 09-02-2008 21:30


All times are GMT -5. The time now is 12:10.

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