Skip to content

Commit 10c82e3

Browse files
committed
improve comments; remove unneeded const
1 parent 0a909d4 commit 10c82e3

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

examples/ble_adafruit_circuitplayground_bluefruit.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Bluefruit Playground server program, to run on Circuit Playground Bluefruit
1+
# Adafruit Service demo for Adafruit CLUE Circuit Playground Bluefruit board.
2+
# Accessible via Adafruit Bluefruit Playground app and Web Bluetooth Dashboard.
23

34
import time
45

56
import board
67
from digitalio import DigitalInOut
78
import neopixel_write
89

9-
from micropython import const
10-
1110
from adafruit_ble import BLERadio
1211

1312
from adafruit_ble_adafruit.adafruit_service import AdafruitServerAdvertisement
@@ -26,7 +25,7 @@
2625
accel_last_update = 0
2726

2827
# 3 RGB bytes * 10 pixels.
29-
NEOPIXEL_BUF_LENGTH = const(3 * 10)
28+
NEOPIXEL_BUF_LENGTH = 3 * 10
3029
neopixel_svc = AddressablePixelService()
3130
neopixel_buf = bytearray(NEOPIXEL_BUF_LENGTH)
3231
# Take over NeoPixel control from cp.

examples/ble_adafruit_clue.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Bluefruit Playground server program, to run on CLUE
1+
# Adafruit Service demo for Adafruit CLUE board.
2+
# Accessible via Adafruit Bluefruit Playground app and Web Bluetooth Dashboard.
23

34
import time
45

5-
from micropython import const
6-
76
import board
87
from digitalio import DigitalInOut
98
import neopixel_write
@@ -30,7 +29,7 @@
3029
accel_last_update = 0
3130

3231
# CLUE has just one board pixel. 3 RGB bytes * 1 pixel.
33-
NEOPIXEL_BUF_LENGTH = const(3 * 1)
32+
NEOPIXEL_BUF_LENGTH = 3 * 1
3433
neopixel_svc = AddressablePixelService()
3534
neopixel_buf = bytearray(NEOPIXEL_BUF_LENGTH)
3635
# Take over NeoPixel control from clue.
@@ -54,7 +53,7 @@
5453
light_last_update = 0
5554

5655
# Send 256 16-bit samples at a time.
57-
MIC_NUM_SAMPLES = const(256)
56+
MIC_NUM_SAMPLES = 256
5857
mic_svc = MicrophoneService()
5958
mic_svc.number_of_channels = 1
6059
mic_svc.measurement_period = 100

examples/ble_adafruit_feather_bluefruit_sense.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
# Bluefruit Playground and Web Bluetooth Dashboard server program, to
2-
# run on Feather Bluefruit Sense
1+
# Adafruit Service demo for Adafruit Feather Bluefruit Sense board.
2+
# Accessible via Adafruit Web Bluetooth Dashboard.
3+
# (As of this writing, not yet accessible via Bluefruit Playground app.)
34

45
import time
56

6-
from micropython import const
7-
87
import board
98

109
import digitalio
1110
import neopixel_write
1211

1312
from adafruit_ble import BLERadio
1413

14+
import audiobusio
15+
1516
import adafruit_apds9960.apds9960
1617
import adafruit_bmp280
1718
import adafruit_lsm6ds
1819
import adafruit_sht31d
1920

20-
import audiobusio
21-
2221
from adafruit_ble_adafruit.adafruit_service import AdafruitServerAdvertisement
2322

2423
from adafruit_ble_adafruit.accelerometer_service import AccelerometerService
@@ -46,12 +45,14 @@
4645
board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16,
4746
)
4847

48+
# Create and initialize the available services.
49+
4950
accel_svc = AccelerometerService()
5051
accel_svc.measurement_period = 100
5152
accel_last_update = 0
5253

53-
# One NeoPixel on the board.
54-
NEOPIXEL_BUF_LENGTH = const(3 * 1)
54+
# Feather Bluefruit Sense has just one board pixel. 3 RGB bytes * 1 pixel
55+
NEOPIXEL_BUF_LENGTH = 3 * 1
5556
neopixel_svc = AddressablePixelService()
5657
neopixel_buf = bytearray(NEOPIXEL_BUF_LENGTH)
5758
neopixel_out = digitalio.DigitalInOut(board.NEOPIXEL)
@@ -75,7 +76,7 @@
7576
light_last_update = 0
7677

7778
# Send 256 16-bit samples at a time.
78-
MIC_NUM_SAMPLES = const(256)
79+
MIC_NUM_SAMPLES = 256
7980
mic_svc = MicrophoneService()
8081
mic_svc.number_of_channels = 1
8182
mic_svc.measurement_period = 100

0 commit comments

Comments
 (0)