Skip to content

Instantly share code, notes, and snippets.

@CoordSpace
CoordSpace / detect_bluetooth.py
Created May 26, 2016 00:22
A simple Python script that will trigger an LED to light up when a known Bluetooth-capable device (such as your phone or fitness band) comes within sensing range.
import bluetooth, time
import Adafruit_BBIO.GPIO as GPIO
search_time = 10
led_pin = "P8_7"
# You can hardcode the desired device ID here as a string to skip the discovery stage
addr = None
print("Welcome to the Bluetooth Detection Demo! \nMake sure your desired Bluetooth-capable device is turned on and discoverable.")