Change connect routine

This commit is contained in:
David Wright 2022-09-26 21:56:10 -06:00
parent 7ee713749f
commit 42c7117c7f

View File

@ -18,10 +18,12 @@ class Droid():
await self.droid.write_gatt_char(0x000d, connectCode, False) await self.droid.write_gatt_char(0x000d, connectCode, False)
await self.droid.write_gatt_char(0x000d, connectCode, False) await self.droid.write_gatt_char(0x000d, connectCode, False)
print("Locked") print("Locked")
soundBank = bytearray.fromhex("27420f4444001f00") light_blink = bytearray.fromhex("2C000449020001ff01ff0aff00")
await self.droid.write_gatt_char(0x000d, soundBank) await self.droid.write_gatt_char(0x000d, light_blink)
soundSelection = bytearray.fromhex("27420f4444001800") soundSelection = bytearray.fromhex("27420f4444001800")
await self.droid.write_gatt_char(0x000d, soundSelection) await self.droid.write_gatt_char(0x000d, soundSelection)
connect_sound = bytearray.fromhex("25000c421102")
await self.droid.write_gatt_char(0x000d, connect_sound)
async def disconnect(self): async def disconnect(self):
print ("Disconnecting") print ("Disconnecting")
@ -52,7 +54,7 @@ async def main():
sleep (3) sleep (3)
try: try:
await arms.run_routine("05") await arms.run_routine("05")
sleep (3) sleep (5)
finally: finally:
await arms.disconnect() await arms.disconnect()
asyncio.run(main()) asyncio.run(main())