Inline callbacks with one-time set function
This release adds functionality that allows the programmer to add a lambda function as a callback just once. Then, it is called whenever Dashboard.update()
is called, and a variable change is present.
Example:
...
class Robot : TimedRobot(0.005) {
...
fun robotInit() {
...
Dashboard.addInlineListener("SOME_VARIABLE") {
key: String, value: Any? ->
println("$key : $value")
}
...
}
...
fun robotPeriodic() {
Dashboard.update() // Any callbacks will be called at this time
...
}
...
}