Go to Post "There's plenty of room on the top for everyone" ... it's not a top if everyone is there. - Alyssa [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
  #2   Spotlight this post!  
Unread 13-02-2009, 15:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Encoder Code

Quote:
Originally Posted by dboisvert View Post
Code:
		// Encoders
		encoderMotor1 = new Encoder(3,4);
		encoderMotor2 = new Encoder(5,6);
Code:
	void EncoderInit(void) {
		encoderMotor1.Start();
		encoderMotor2.Start();
	}
We receive errors on the lines encoderMotor1.Start(); & encoderMotor2.Start();
Your encoderMotorN variables are pointers to Encoder objects. The C++ "dot" syntax is used with objects themselves; use the "->" syntax instead when working with object pointers, like this:
Code:
	void EncoderInit(void) {
		encoderMotor1->Start();
		encoderMotor2->Start();
	}
Doesn't the Get() method return a float? The %d format specifier in your printf() is probably going to be an issue.
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 18-02-2008 12:56
Gear encoder code Demothesis Programming 8 20-07-2007 17:15
Vex Encoder Code CircularLogic FIRST Tech Challenge 7 09-08-2006 22:12
Combining camera + encoder code kiettyyyy Programming 5 13-04-2006 09:39
Issues with encoder code jgannon Programming 7 26-03-2006 15:12


All times are GMT -5. The time now is 02:56.

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