Created
July 14, 2015 16:52
-
-
Save jamesabruce/ef2f418d91f188fe7d04 to your computer and use it in GitHub Desktop.
Detect user through Bluetooth demo, Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import bluetooth | |
import time | |
while True: | |
print "Checking " + time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime()) | |
result = bluetooth.lookup_name('78:7F:70:38:51:1B', timeout=5) | |
if (result != None): | |
print "User present" | |
else: | |
print "User out of range" | |
time.sleep(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! Nice pieces of code you have around ...