How to use the cflib.crazyflie.mem.MemoryElement function in cflib

To help you get started, we’ve selected a few cflib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitcraze / crazyflie-clients-python / examples / write-ow.py View on Github external
def _connected(self, link_uri):
        """ This callback is called form the Crazyflie API when a Crazyflie
        has been connected and the TOCs have been downloaded."""
        print("Connected to %s" % link_uri)

        mems = self._cf.mem.get_mems(MemoryElement.TYPE_1W)
        print("Found {} 1-wire memories".format(len(mems)))
        if len(mems) > 0:
            print("Writing test configuration to"
                  " memory {}".format(mems[0].id))

            mems[0].vid = 0xBC
            mems[0].pid = 0xFF

            board_name_id = OWElement.element_mapping[1]
            board_rev_id = OWElement.element_mapping[2]

            mems[0].elements[board_name_id] = "Test board"
            mems[0].elements[board_rev_id] = "A"

            mems[0].write_data(self._data_written)
github bitcraze / crazyflie-clients-python / examples / flash-memory.py View on Github external
def search_memories(self):
        """
        Search and return list of 1-wire memories.
        """
        if not self.connected:
            raise NotConnected()
        return self._cf.mem.get_mems(MemoryElement.TYPE_1W)
github bitcraze / crazyflie-clients-python / src / cfclient / ui / dialogs / about.py View on Github external
def _request_deck_data_update(self):
        self._decks_text = ""
        mems = self._helper.cf.mem.get_mems(MemoryElement.TYPE_1W)
        for mem in mems:
            mem.update(self._cb_deck_data_updated_signal.emit)
github bitcraze / crazyflie-clients-python / src / cfclient / ui / tabs / locopositioning_tab.py View on Github external
def _poll_anchor_positions(self):
        mems = self._helper.cf.mem.get_mems(MemoryElement.TYPE_LOCO)
        if len(mems) > 0:
            mems[0].update(self._anchor_position_signal.emit)