Go to Post These teams aren't elitists, but they sure are elite. - [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 02-13-2009, 03:31 PM
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Encoder Code

Includes the Encoder Header Files

Code:
#include "Encoder.h"
Declared the Encoder Variables

Code:
	// Declare Encoder Variables for Input
	Encoder *encoderMotor1;
	Encoder *encoderMotor2;
We plugged the into Digital Inputs 3,4 & 5,6

Code:
		// Encoders
		encoderMotor1 = new Encoder(3,4);
		encoderMotor2 = new Encoder(5,6);
Created a function in the Initialize Area to start the encoders

Code:
	void EncoderInit(void) {
		encoderMotor1.Start();
		encoderMotor2.Start();
	}
Lastly we decided to use the print function to get the encoder values in the debug console

Code:
		// Encoder printf
		printf("%d %d\n", encoderMotor1->Get(), encoderMotor2->Get());
We receive errors on the lines encoderMotor1.Start(); & encoderMotor2.Start();

Error: Request for member 'Start' in '((BuiltinDefaultCode*)this)->BuiltinDefaultCode::encoderMotor1', which is of non-class type 'Encoder*'

Error: Request for member 'Start' in '((BuiltinDefaultCode*)this)->BuiltinDefaultCode::encoderMotor2', which is of non-class type 'Encoder*'


Any help would be much appreciated... I probably just need another pair of eyes on the code.
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
Encoder Code Kevin Watson Programming 47 02-18-2008 12:56 PM
Gear encoder code Demothesis Programming 8 07-20-2007 05:15 PM
Vex Encoder Code CircularLogic FIRST Tech Challenge 7 08-09-2006 10:12 PM
Combining camera + encoder code kiettyyyy Programming 5 04-13-2006 09:39 AM
Issues with encoder code jgannon Programming 7 03-26-2006 03:12 PM


All times are GMT -5. The time now is 09:36 AM.

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