Git Product home page Git Product logo

ftc6299's Introduction

FTC Team QUADX 6299 Source Code

See our cheat sheet on how to use GitHub.

"libs.h"

valInRange(float val, float threshold = 1.0)

  • Tests if the the absolute value of the val parameter is less than the threshold and returns a boolean
  • Threshold parameter default is 1.0

getEncoderAverage(int leftMotor, int rightMotor)

  • Averages out the two paramters entered and returns a integer
  • Failsafe if either left-side motor encoder or right-side motor encoder dies

setMotors(int left, int right)

  • Sets the left-side drive motors to the first parameter entered and the right-side drive motors to the second parameter

stopMotors()

  • Stops all of the drive motors

moveTo(int power, int deg, float threshold = 2.0, long time = 5000, float cor = 4.0)

  • Moves the robot forward or backward the amount of degrees entered in the deg parameter at the power of the power parameter
  • In order for the robot to move backward make the power and deg parameters negative
  • The robot will correct its direction by changing motor speeds if the robot's drift in degrees gets out of the threshold parameter
  • If the method runs for more than the time paratemeter the method will stop as a failsafe in case the encoders fail

turn(int power, int deg, int time = 5000)

  • The robot will turn for the degrees given in the deg parameter on a point at the power of the power parameter
  • The turn method only turns 45° and 90° currently
  • If the method runs for more than the time parameter the method will stop for a failsafe if the gyro fails

arcTurn(int power, int deg, int time = 2000)

  • Turns on one stopped motor for the degrees given in the deg parameter at the power of the power parameter
  • The turn method only turns 45° and 90° currently
  • If the method runs for more than the time parameter the method will stop for a failsafe in the gyro fails

getIR()

  • Returns IR value

moveIrUp(int speed, int IR)

  • Moves the robot until the IR value becomes greater then the IR parameter

moveIrDown(int speed, int IR)

  • Moves the robot until the IR value becomes less then the IR parameter

sendArduinoCommand(unsigned char command)

  • Send a command to the Arduino Pro Mini atMega via the hitechnic SuperPro
  • Addition of the "HTSPBWriteStrobe" to the hitechnic-superpro.h file is necessary for this to work
  • Commands available to send to the Arduino:
    1. Command = 1: Tell the arduino to blink its LED (mostly for debug)
    2. Command = 2: Tell Arduino to send current heading from the MPU6050 gyro
    3. Command = 3: Tell the Arduino to send raw acceleration on the x-axis

getMPUHeading()

  • Reads and returns the current heading from the MPU6050

getMPUAccelX()

  • Reads and returns the current x acceleration from the MPU6050

ftc6299's People

Contributors

jspspike avatar tryptophan avatar linnealovespie avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.