Go to Post FIRST is here to reach the affluent, already college-bound students with boundless resources; it is also here to reach the poverty-stricken urban and rural students who don't see a diploma as worthwhile, and everybody in between. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-03-2010, 00:07
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: LM_API_CFG_NUM_BRUSHES

So, the banebots RS-555 has 5 brushes. If I had a jaguar on the CAN bus, could the brush count be used for either the Position or speed control mode?

would something like this work?

Code:
public static class PositionReference {

        public final byte value;
        static final byte kEncoder_val = 0;
        static final byte kPotentiometer_val = 1;
        static final byte kBrushes_val = 2;
        public static final PositionReference kEncoder = new PositionReference(kEncoder_val);
        public static final PositionReference kPotentiometer = new PositionReference(kPotentiometer_val);
        public static final PositionReference kBrushes = new PositionReference(kBrushes_val);

        private PositionReference(byte value) {
            this.value = value;
        }
    }

public void configMotorBrushes(short brushes) {
        byte[] dataBuffer = new byte[8];
        byte dataSize;

        dataSize = packINT16(dataBuffer, brushes);
        setTransaction(LM_API_CFG_NUM_BRUSHES, dataBuffer, dataSize);
    }

CANJaguar brushedDCMotor = new CANJaguar(2, ControlMode.kPosition);
brushedDCMotor.setPositionReference(PositionReference.kBrushes);
brushedDCMotor.configMotorBrushes(5);
brushedDCMotor.enableControl(0.0);
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
Reply With Quote
Reply


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


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

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