We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ad9583 commit a808dbdCopy full SHA for a808dbd
MagicbotSimple/components/component2.py
@@ -7,7 +7,7 @@
7
import wpilib
8
from .component1 import Component1
9
10
-from magicbot import will_reset_to
+from magicbot import feedback, will_reset_to
11
12
13
class Component2:
@@ -29,6 +29,12 @@ def on_enable(self):
29
def do_something(self):
30
self.did_something = True
31
32
+ # Use @feedback to send state external to the robot code to NetworkTables.
33
+ # This will be called after execute().
34
+ @feedback
35
+ def get_motor_voltage(self) -> float:
36
+ return self.some_motor.getVoltage()
37
+
38
def execute(self):
39
if self.did_something:
40
self.some_motor.set(1)
0 commit comments