1 of 8

Circuit Playground BlueFruit

What you will learn:

-Bluefruit Communication Terms

-Python

-How to Set up the Bootloader and Lib folder for Circuit Playground Express

-How to call basic functions

2 of 8

Bluetooth Vocab

  • Central - The host computer. This is often a mobile device such as a phone or tablet, or it could be a desktop or laptop.
  • Peripheral - The connected device. Examples of peripherals are: heart rate monitor, smart watch, or fitness tracker. The CircuitPython code we have so far is designed to make the Adafruit nRF52840 devices work as peripherals.
  • Advertising - Information sent by the peripheral during connection set up. When a device advertises, it is transmitting the name of the device and describing its capabilities. The central looks for an advertising peripheral to connect to, and uses that information to determine what the peripheral is capable of.
  • Service - A function the peripheral provides. The peripheral advertises its services. A really common service that we use is the UART service, which acts like a hardware UART and is a way of bidirectionally sending information to and from devices.
  • Packet - Data transmitted by a device. BLE devices and host computers transmit and receive data in small bursts called packets.

Source: https://learn.adafruit.com/circuitpython-nrf52840/bluetooth-basics

3 of 8

SETTING UP Circuit Playground Bluefruit

Step 1.

Newest Bootloader

https://circuitpython.org/board/circuitplayground_bluefruit/ Double Click the reset button until says

CLAYBOOT then you drag uf2 on it

Step 2.

Download Lib folder w/ following libraries, unzip

https://circuitpython.org/libraries

4 of 8

SETTING UP Circuit Playground Bluefruit

Put these files in the lib folder on the Circuit Playground Bluefruit

adafruit_ble

adafruit_bluefruit_connect

adafruit_bus_device

adafruit_circuitplayground

adafruit_gizmo

adafruit_hid

adafruit_lis3dh.mpy

Adafruit_thermistor.mpy

neopixel.mpy

5 of 8

SETTING UP Circuit Playground Bluefruit

Step 3.

Download Adafruit Bluefruit App to your phone or tablet

The Bluefruit LE Connect app provides iOS & Android devices with a variety of tools to communicate with Bluefruit LE devices. These tools cover basic communication and info reporting as well as more project specific uses such as Arduino Pin Control and a Color Picker.

The iOS app is a free download from Apple's App Store. It requires iOS 11.3 or later and works on iPhones, iPads, and iPod Touches.

The Android app is a free download from the Google Play Store. It requires Android 4.4 or later.

6 of 8

SETTING UP Circuit Playground Bluefruit

from adafruit_ble import BLERadio

from adafruit_ble.advertising.standard import ProvideServicesAdvertisement

from adafruit_ble.services.nordic import UARTService

ble = BLERadio()

uart = UARTService()

advertisement = ProvideServicesAdvertisement(uart)

ble.start_advertising(advertisement)

while True:

# Normally other work would be done here after connecting.

pass

7 of 8

SETTING UP Circuit Playground Bluefruit

Step 5.

Since this is a class and there are multiple boards open the Serial in Mu and run this code to find your board name.

from adafruit_ble import BLERadio

ble = BLERadio()

Ble.name

Step 6.

https://learn.adafruit.com/circuitpython-nrf52840/bluefruit-le-connect-basics

8 of 8

SETTING UP Circuit Playground Bluefruit