-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRobot.java
48 lines (42 loc) · 1.07 KB
/
Robot.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Defines autonomous and operational control of the Kaua'iBots LEDRobot using the following components:
* Addressable RGB 120-LED Strip, 5V, 2m (APA102C) https://www.pololu.com/product/2556
* National Instruments' RoboRio
*/
package org.usfirst.frc.team2465.robot;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
public class Robot extends SampleRobot {
Joystick stick;
LEDStrip strip;
public Robot() {
strip = new LEDStrip();
stick = new Joystick(0);
}
/**
* null
*/
public void autonomous() {
}
/**
* Blinks a light autonomously
*/
public void operatorControl() {
while (isOperatorControl() && isEnabled()) {
strip.startFrame();
for(int i=1 ; i<=120 ; i++){
strip.randomFrame();
}
Timer.delay(.1);
}
}
/**
* Runs during test mode
*/
public void test() {
while (isEnabled()) {
strip.test();
Timer.delay(.1);}
}
}