FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW programing a motor with a color sensor v3

Solved!
Go to solution

How can I make an engine work when it detects a color, I already have the color detector programmed that is what I could achieve by reading the documentation but it does not mark how I can run the engine when I detect the information and I have not yet found a way to know if the sensor is working correctly then if there is a way that can show me in the drive station or make the engine work it would be very helpful to control the programming of the teleop where I have the color detector

Davidrj28_0-1582071408505.png

the select is has conecting in a array of buttons

 

0 Kudos
Message 1 of 2
(3,707 Views)
Solution
Accepted by topic author Davidrj28

Davidrj28, there are multiple ways to ease the programming of these feature:

 

  1. You can use interactive execution (click the run arrow in the Robot Main.vi) to execute your code while connected to the roboRIO and use the LabVIEW debugging tools to look for values in the wires, breakpoints, and more.
  2. Using interactive execution, you can also use controls and indicators in front panels to interact with your VIs. I recommend printing out the value received from the sensor to an indicator in the front panel.
  3. You can also send the values to the dashboard using Network Tables. You can find an example here: FRC Dashboard Tutorial

 

As an example: my team did an experiment where the color sensor would return the color string, and using a case structure we would ask a motor (equipped with an encoder, such as a Falcon 500) to turn to the next color and repeat the sequence until we get the desired color/rotations in the control panel.

 

All the best,

0 Kudos
Message 2 of 2
(3,676 Views)