controllables.BubbleMachine

class controllables.BubbleMachine(port: Optional[int] = None)

Reference to a bubble machine part.

The following example assumes a bubble machine is assigned to port 0 of the microcontroller

from time import sleep
from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
emit()

Emits a single bubble burst.

from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
bblMachine.emit()
auto_emit(set: bool)

Set auto emit on/off

from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
bblMachine.emit_rate = 10
bblMachine.auto_emit(True)
sleep(5)
bblMachine.auto_emit(False)
property emit_rate: float

The rate of emission (ranging 1-10).

from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
bblMachine.emit_rate = 10
bblMachine.auto_emit(True)
from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
print(f'emit rate: {bblMachine.emit_rate:0.1f}')
property particles_per_emission: float

Particles per emission (ranging 1-5).

from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
bblMachine.particles_per_emission = 5
bblMachine.auto_emit(True)
from controllables import BubbleMachine

bblMachine = BubbleMachine(0)
print(f'power: {bblMachine.particles_per_emission:0.1f}')
name() str

Returns the user editable name of the controllable as found in the properties tab of the game.

The following example assumes that any controllable or sensor is assigned to port 0 and prints out its name.

from ports import PortReference

print(PortReference(0).name())