File tree Expand file tree Collapse file tree 7 files changed +64
-23
lines changed
flywheel-bangbang-controller Expand file tree Collapse file tree 7 files changed +64
-23
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- """
3
- This is a sample program demonstrating how to communicate to a light controller from the robot
4
- code using the roboRIO's DIO ports.
5
- """
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
6
7
7
8
import wpilib
8
9
9
10
10
11
class MyRobot (wpilib .TimedRobot ):
12
+ """
13
+ This is a sample program demonstrating how to communicate to a light controller from the robot
14
+ code using the roboRIO's DIO ports.
15
+ """
16
+
11
17
# define ports for digitalcommunication with light controller
12
18
kAlliancePort = 0
13
19
kEnabledPort = 1
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
2
7
3
8
import wpilib
4
9
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
2
7
3
8
import wpilib
4
9
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- """
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
7
+
8
+ import wpilib
9
+
10
+ import math
11
+
12
+
13
+ class MyRobot (wpilib .TimedRobot ):
14
+ """
3
15
Sample program displaying the value of a quadrature encoder on the SmartDashboard. Quadrature
4
16
Encoders are digital sensors which can detect the amount the encoder has rotated since starting
5
17
as well as the direction in which the encoder shaft is rotating. However, encoders can not tell
10
22
distance, as specified by DistancePerPulse. One of the most common uses of encoders is in the
11
23
drivetrain, so that the distance that the robot drives can be precisely controlled during the
12
24
autonomous mode.
13
- """
25
+ """
14
26
15
- import wpilib
16
-
17
- import math
18
-
19
-
20
- class MyRobot (wpilib .TimedRobot ):
21
27
def robotInit (self ):
22
28
"""Robot initialization function"""
23
29
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- """
3
- This is a sample program to demonstrate the use of a BangBangController with a flywheel to
4
- control RPM.
5
- """
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
6
7
7
8
import wpilib
8
9
import wpilib .simulation
14
15
15
16
16
17
class MyRobot (wpilib .TimedRobot ):
18
+ """
19
+ This is a sample program to demonstrate the use of a BangBangController with a flywheel to
20
+ control RPM.
21
+ """
22
+
17
23
kMotorPort = 0
18
24
kEncoderAChannel = 0
19
25
kEncoderBChannel = 1
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- """
3
- This is a sample program that uses mecanum drive with a gyro sensor to maintain rotation vectors
4
- in relation to the starting orientation of the robot (field-oriented controls).
5
- """
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
7
+
6
8
7
9
import wpilib
8
10
import wpilib .drive
9
11
10
12
11
13
class MyRobot (wpilib .TimedRobot ):
14
+ """
15
+ This is a sample program that uses mecanum drive with a gyro sensor to maintain rotation vectors
16
+ in relation to the starting orientation of the robot (field-oriented controls).
17
+ """
18
+
12
19
# gyro calibration constant, may need to be adjusted;
13
20
# gyro value of 360 is set to correspond to one full revolution
14
21
kVoltsPerDegreePerSecond = 0.0128
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- """
3
- This is a demo program showing the use of GenericHID's rumble feature.
4
- """
2
+ #
3
+ # Copyright (c) FIRST and other WPILib contributors.
4
+ # Open Source Software; you can modify and/or share it under the terms of
5
+ # the WPILib BSD license file in the root directory of this project.
6
+ #
5
7
6
8
import wpilib
7
9
8
10
9
11
class MyRobot (wpilib .TimedRobot ):
12
+ """
13
+ This is a demo program showing the use of GenericHID's rumble feature.
14
+ """
15
+
10
16
def robotInit (self ):
11
17
"""Robot initialization function"""
12
18
You can’t perform that action at this time.
0 commit comments