Go to Post Or, to put it another way: It's a sport where you build your own athlete. - EricH [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Spotlight this post!  
Unread 12-03-2008, 13:22
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,534
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: HM55B Digital Compass - How do I program the controller to read it?

If you continue to have issues, consider doing this:

encoder_error = left_encoder_count - right_encoder_count;
encoder_output = encoder_error * encoder_gain;
if (encoder_output > 127)
encoder_output = 127;
else if (encoder_output < -127)
encoder_output = -127;

Left_Drive = 127 + <insert_your_left_drive_value> - encoder_output;
Right_Drive = 127 + <insert_your_right_drive_value> + encoder_output;

Adjust your gain until it drives roughly straight. It won't be perfect, but it might work well enough for you.
 


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
Interfacing a digital compass with the RC Kelly Electrical 14 27-09-2007 19:01
Where can I get a digital compass sensor? EHaskins Technical Discussion 6 26-09-2007 18:33
How Can I Program The FRC Robot Controller To Display My Team Number jesusescobar Programming 5 22-01-2007 10:29
Problem with the program downloaded to the controller itsme Programming 9 14-01-2007 12:12
I2C Digital Compass Programming CyberWolf_22 Programming 7 03-01-2005 00:20


All times are GMT -5. The time now is 20:22.

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