def begin(self, vcc_state=SWITCH_CAP_VCC):
        time.sleep(0.001) # 1ms
        self.reset()
        self.command(self.DISPLAY_OFF)
        self.command(self.SET_DISPLAY_CLOCK_DIV, 0x80)

        # support for 128x32 and 128x64 line models
        if self.rows == 64:
            self.command(self.SET_MULTIPLEX, 0x3F)
            self.command(self.SET_COM_PINS, 0x12)
        else:
            self.command(self.SET_MULTIPLEX, 0x1F)
            self.command(self.SET_COM_PINS, 0x02)

        self.command(self.SET_DISPLAY_OFFSET, 0x00)
        self.command(self.SET_START_LINE | 0x00)
        if vcc_state == self.EXTERNAL_VCC:
            self.command(self.CHARGE_PUMP, 0x10)
        else:
            self.command(self.CHARGE_PUMP, 0x14)
        self.command(self.SET_MEMORY_MODE, 0x00)
        self.command(self.SEG_REMAP | 0x01)
        self.command(self.COM_SCAN_DEC)
        self.command(self.SET_CONTRAST, 0x8f)
        if vcc_state == self.EXTERNAL_VCC:
            self.command(self.SET_PRECHARGE, 0x22)
        else:
            self.command(self.SET_PRECHARGE, 0xF1)
        self.command(self.SET_VCOM_DETECT, 0x40)
        self.command(self.DISPLAY_ALL_ON_RESUME)
        self.command(self.NORMAL_DISPLAY)
        self.command(self.DISPLAY_ON)