Skip to content

Commit 18d86b1

Browse files
committed
SmartIO changes
1 parent e6f7a9d commit 18d86b1

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

AddressableLED/robot.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
class MyRobot(wpilib.TimedRobot):
1414
def robotInit(self):
15-
# PWM Port 9
16-
# Must be a PWM header, not MXP or DIO
17-
self.led = wpilib.AddressableLED(9)
15+
# SmartIO port 1
16+
self.led = wpilib.AddressableLED(1)
1817

1918
# LED Data
2019
self.ledData = [wpilib.AddressableLED.LEDData() for _ in range(kLEDBuffer)]
@@ -28,7 +27,6 @@ def robotInit(self):
2827

2928
# Set the data
3029
self.led.setData(self.ledData)
31-
self.led.start()
3230

3331
def robotPeriodic(self):
3432
# Fill the buffer with a rainbow

DutyCycleInput/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MyRobot(wpilib.TimedRobot):
1212
def robotInit(self):
1313
"""Robot initialization function"""
1414

15-
self.dutyCycle = wpilib.DutyCycle(wpilib.DigitalInput(0))
15+
self.dutyCycle = wpilib.DutyCycle(0)
1616

1717
def robotPeriodic(self):
1818
# Duty Cycle Frequency in Hz

0 commit comments

Comments
 (0)