Běh Briana

povolit vypnutí tlačítky

brian.runtime.enable_turn_off_by_buttons(enabled: bool) None

If enabled (default), first press of any left together with any right button will send a KeyboardInterrupt. The second such press will hard abort the program. If disabled, the buttons will not be watched and the program can use them fully according to the programmer’s needs. It is the programmer’s responsibility to provide alternative shutdown mechanism. If no such mechanism is provided, the only two ways to exit a stuck program is to either eject the sd card or force power off of the entire brick.

Parametry:

enabled – true if the Brian should watch for the turn-off button pattern, false to ignore it.

vypnutí

brian.runtime.power_off() None

Vypne Briana.

Když je požadováno vypnutí Briana, ale Brian je stále připojen k napájení přes USB, je provedeno pouze částečné vypnutí. Všechny periferie (porty, audio, displej, …) jsou vypnuty, ale vnitřní funkce, jako je nabíjení baterie a monitorování, nadále běží.

restartuj Briana

brian.runtime.reboot_brian() None

Reastartuje Briana

Vrátí Briana do hlavního menu.