This callback is called form the Crazyflie API when a Crazyflie has been connected and the TOCs have been downloaded.
(self, link_uri)
| 66 | self.is_connected = True |
| 67 | |
| 68 | def _connected(self, link_uri): |
| 69 | """ This callback is called form the Crazyflie API when a Crazyflie |
| 70 | has been connected and the TOCs have been downloaded.""" |
| 71 | print('Connected to %s' % link_uri) |
| 72 | |
| 73 | mems = self._cf.mem.get_mems(MemoryElement.TYPE_I2C) |
| 74 | print('Found {} EEPOM(s)'.format(len(mems))) |
| 75 | if len(mems) > 0: |
| 76 | print('Writing default configuration to' |
| 77 | ' memory {}'.format(mems[0].id)) |
| 78 | |
| 79 | elems = mems[0].elements |
| 80 | elems['version'] = 1 |
| 81 | elems['pitch_trim'] = 0.0 |
| 82 | elems['roll_trim'] = 0.0 |
| 83 | elems['radio_channel'] = 80 |
| 84 | elems['radio_speed'] = 0 |
| 85 | elems['radio_address'] = 0xE7E7E7E7E7 |
| 86 | |
| 87 | mems[0].write_data(self._data_written) |
| 88 | |
| 89 | def _data_written(self, mem, addr): |
| 90 | print('Data written, reading back...') |
nothing calls this directly
no test coverage detected