top of page
  • Writer's pictureQuan Sheng

Bluetooth on Pi

Instead of using the kit, let's try using the component that is inbuilt to the Raspberry Pi such as the Bluetooth.

Bluetooth

The Pi scans for any nearby device that have their Bluetooth turned on.


The devices that have a Bluetooth accessory sent out a signal containing information about their device to alert other nearby devices of its presence and capabilities.


Therefore, the pi captures the device and shows the output as the screen shown.


Python code:

nearby_devices = bluetooth.discover_devices(duration=5, lookup_names=True)

In this code, its discovering device and stores into the variable.


bluetooth.lookup_name('14:1A:A3:98:9B:1C', timeout=10)


Stay tuned for the next "Using the Pi componenets!"



2 views

Comments


bottom of page