def format_memory(): explorer = Explore() parser = argparse.ArgumentParser( description='format the memory of selected explore device') parser.add_argument("-a", "--address", dest="address", type=str, default=None, help="Explore device's MAC address.") parser.add_argument("-n", "--name", dest="name", type=str, default=None, help="Name of the device.") args = parser.parse_args(sys.argv[2:]) if args.name is None: explorer.connect(device_addr=args.address) elif args.address is None: explorer.connect(device_name=args.name) from explorepy import command memory_format_cmd = command.MemoryFormat() explorer.change_settings(memory_format_cmd)
def set_sampling_rate(): explorer = Explore() parser = argparse.ArgumentParser( description= 'format the memory of selected explore device (yet in alpha state)' ) parser.add_argument("-a", "--address", dest="address", type=str, default=None, help="Explore device's MAC address.") parser.add_argument("-n", "--name", dest="name", type=str, default=None, help="Name of the device.") parser.add_argument( "-r", "--sampling_rate", dest="sampling_rate", type=str, default=None, help="Sampling rate of ExG channels, it can be 250, 500 or 1000.") args = parser.parse_args(sys.argv[2:]) if args.name is None: explorer.connect(device_addr=args.address) elif args.address is None: explorer.connect(device_name=args.name) from explorepy import command if args.sampling_rate is None: raise ValueError("Please specify the sampling rate") elif args.sampling_rate == '250': explorer.change_settings(command.SetSPS(250)) elif args.sampling_rate == '500': explorer.change_settings(command.SetSPS(500)) elif args.sampling_rate == '1000': explorer.change_settings(command.SetSPS(1000)) else: raise ValueError( "The only acceptable values are 250, 500 or 1000.")