I am trying to implement this with a buzzer and raspberry pi 3. That the condition is when the heart rate is below 60 it will alarm the buzzer but I am getting this error
typeerror:unorderable types:nonetype() < int()
i am using a code similarly to yours so I hope you could help me. Im new this sorry for my ignorance
here is the code
`#!/usr/bin/env python2
import struct
import time
import sys
import argparse
from Crypto.Cipher import AES
from bluepy.btle import Peripheral, DefaultDelegate, ADDR_TYPE_RANDOM
from gpiozero import Buzzer
from time import sleep
buzzer = Buzzer (17)
''' TODO
Key should be generated and stored during init
'''
I am trying to implement this with a buzzer and raspberry pi 3. That the condition is when the heart rate is below 60 it will alarm the buzzer but I am getting this error
typeerror:unorderable types:nonetype() < int()
i am using a code similarly to yours so I hope you could help me. Im new this sorry for my ignorance
here is the code
`#!/usr/bin/env python2 import struct import time import sys import argparse from Crypto.Cipher import AES from bluepy.btle import Peripheral, DefaultDelegate, ADDR_TYPE_RANDOM from gpiozero import Buzzer from time import sleep buzzer = Buzzer (17) ''' TODO Key should be generated and stored during init '''
UUID_SVC_MIBAND2 = "0000fee100001000800000805f9b34fb" UUID_CHAR_AUTH = "00000009-0000-3512-2118-0009af100700" UUID_SVC_ALERT = "0000180200001000800000805f9b34fb" UUID_CHAR_ALERT = "00002a0600001000800000805f9b34fb" UUID_SVC_HEART_RATE = "0000180d00001000800000805f9b34fb" UUID_CHAR_HRM_MEASURE = "00002a3700001000800000805f9b34fb" UUID_CHAR_HRM_CONTROL = "00002a3900001000800000805f9b34fb"
HRM_COMMAND = 0x15 HRM_MODE_SLEEP = 0x00 HRM_MODE_CONTINUOUS = 0x01 HRM_MODE_ONE_SHOT = 0x02
CCCD_UUID = 0x2902
class MiBand2(Peripheral): _KEY = b'\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x40\x41\x42\x43\x44\x45' _send_key_cmd = struct.pack('<18s', b'\x01\x08' + _KEY) _send_rnd_cmd = struct.pack('<2s', b'\x02\x08') _send_enc_key = struct.pack('<2s', b'\x03\x08')
class AuthenticationDelegate(DefaultDelegate):
def main(): """ main func """ parser = argparse.ArgumentParser() parser.add_argument('host', action='store', help='MAC of BT device') parser.add_argument('-t', action='store', type=float, default=3.0, help='duration of each notification')
if name == "main": main()
`