Go to Post I suggest that FIRST should include a "big red button" in the KOP next year to make everyone happy. :p - Jay H 237 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 28-11-2015, 15:40
FTC 7037 FTC 7037 is offline
FTC Team
FTC #7037 (Duck and Cover)
 
Join Date: Nov 2015
Rookie Year: 2012
Location: Virginia
Posts: 3
FTC 7037 is an unknown quantity at this point
Question FTC Legacy Module

Our team is having problems with getting the legacy module to power the motors. We have checked all of the ports on the legacy module for problems and we have switched out the motors and the and the motor controllers. Using experimentation we have determined that we can read and write to the motor controller and we can read encoder values from the motor but we cannot set the motor power. Below is a copy of our test code:

Code:
package com.qualcomm.ftcrobotcontroller.opmodes;

import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorController;
import com.qualcomm.robotcore.hardware.TouchSensor;

public class testTeleop extends OpMode {
    DcMotor Test;
    DcMotorController.DeviceMode devMode;
    DcMotorController Testcontroller;
    TouchSensor touch;
    @Override
    public void init() {
        Test = hardwareMap.dcMotor.get("test");
        Test.setMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS);
        Testcontroller = hardwareMap.dcMotorController.get("testcon");
        Testcontroller.setMotorControllerDeviceMode(devMode.WRITE_ONLY);
        touch = hardwareMap.touchSensor.get("touchey");
    }
    @Override
    public void loop() {
        //Test.setPower(1.0);
        //Testcontroller.setMotorPower(2, 1.0);
        /*
        if(gamepad2.dpad_down){
            telemetry.addData("Controller mode", Testcontroller.getMotorChannelMode(2));
        }
        if(gamepad2.dpad_up){
            Testcontroller.setMotorChannelMode(2, DcMotorController.RunMode.RUN_TO_POSITION);
        }
        if(gamepad2.dpad_right){
            Testcontroller.setMotorControllerDeviceMode(devMode.READ_ONLY);
        }
        */
        //telemetry.addData("From motor", Test.getCurrentPosition());
        //telemetry.addData("From Controller", Testcontroller.getMotorCurrentPosition(2));

        if(gamepad2.dpad_up){
            Test.setPower(1.0);
            Testcontroller.setMotorPower(1, 1.0);
            Testcontroller.setMotorPower(2, 1.0);
            telemetry.addData("Going up?", "nope");
        }
        else if(gamepad2.dpad_down) {
            Test.setPower(-1.0);
            Testcontroller.setMotorPower(1, -1.0);
            Testcontroller.setMotorPower(2, -1.0);
            telemetry.addData("Going down?", "nope");
        }
        else{
            Test.setPower(0.0);
            Testcontroller.setMotorPower(1, 0.0);
            Testcontroller.setMotorPower(2, 0.0);
            telemetry.addData("Not moving?", "no problem");
        }

        if(touch.isPressed()){//For checking the ports on the legacy control module
            telemetry.addData("Touch sensor is ", "pressed");
        }
        else if(!touch.isPressed()){
            telemetry.addData("Touch sensor is ", "not pressed");
        }
        else{
            telemetry.addData("How the hell did a touch sensor pass a third value?", "I know right?");
        }
    }
}
Thanks in advance from Team 7037.
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


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

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