_mode = mode def set_cursor ( self, row, column ): self. _inverse = enable def mode ( self ): return self. send_command ( _INVERSE_DISPLAY if enable else _NORMAL_DISPLAY ) self. setter def inverse ( self, enable ): self. set_cursor ( 0, 0 ) def inverse ( self ): return self. send_command ( c ) def clear ( self ): self. address, _DATA_MODE, data ) def send_commands ( self, commands ): for c in commands : self.
address, _COMMAND_MODE, command ) def send_data ( self, data ): self. send_command ( _DISPLAY_OFF ) def send_command ( self, command ): self. send_command ( _DISPLAY_ON ) def off ( self ): self.
Connect the Raspberry Pi to PC through USB cable. Connect the OLED display to the I 2C port of the Base Hat. Play With Raspberry Pi (With Grove Base Hat for Raspberry Pi) ¶ Hardware ¶