mplacona
07/09/2017, 10:33 AMvoddan
07/09/2017, 11:03 AMvoddan
07/09/2017, 11:06 AMobject : Runnable {
can be just a lambdavoddan
07/09/2017, 11:11 AMwhen
with 2 options should really be an if, or a binary expression:
ledControl.setLed(0, 0, 1, hour in 10..19)
voddan
07/09/2017, 11:12 AMledControl.setLed(0, 1, 1, hourUnit in setOf(1, 3, 5, 7, 9))
voddan
07/09/2017, 11:15 AMledControl.setLed(0, 2, 1, minute in (10..19) + (30..39) + (50..59))
voddan
07/09/2017, 11:17 AMvoddan
07/09/2017, 11:20 AMoperator fun MAX72XX.set(x: Int, y: Int, z: Int, value: Boolean) = setLed(x, y, z, value)
. Then their usage becomes ledControl[0, 2, 1] = true
mplacona
07/09/2017, 7:11 PMvoddan
07/09/2017, 7:17 PM