Skip to content

Commit 3ad9602

Browse files
author
Kevin J Walters
committed
Cleaning up unused code. Adding comment about board.D8 use being the thing that dictates use of adalogger version of Feather CircuitPython.
1 parent f08671e commit 3ad9602

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

feather-m0/bluetooth-microscout-vll-control.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### bluetooth-microscout-vll-control v0.9
1+
### bluetooth-microscout-vll-control v1.0
22
### Bluetooth Remote Control for the Micro Scout from Lego(tm) Droid Developer Kit
33
### On an Adafruit Feather M0 Bluetooth LE board
44
### or a CircuitPython compatible board using the Adafruit Bluefruit LE SPI Friend
@@ -40,6 +40,8 @@
4040
from adafruit_bluefruitspi import BluefruitSPI
4141

4242
### Setup SPI bus and 3 control pins for Nordic nRF51822 based Raytec MDBT40
43+
### board.D8 is not defined on the basic CircuitPython hence the strange
44+
### need to use the adalogger variant
4345
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
4446
cs = DigitalInOut(board.D8)
4547
irq = DigitalInOut(board.D7)
@@ -49,7 +51,6 @@
4951
### see https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI/issues/8
5052
bluefruit = BluefruitSPI(spi_bus, cs, irq, rst, debug=False)
5153

52-
5354
boardled = DigitalInOut(board.D6)
5455
##boardled = DigitalInOut(board.D13) ### small onboard red LED
5556
boardled.direction = Direction.OUTPUT
@@ -71,7 +72,6 @@ def vllchksum(n):
7172
PAUSE = 0.15
7273

7374
ADVERT_NAME = b'BlueMicroScout'
74-
##ADVERT_NAME = b'BlinkaNeoLamp'
7575

7676
### Note: incompatibile with ZX Spectrum cursors
7777
BUTTON_1 = const(1)
@@ -130,15 +130,9 @@ def pause():
130130
boardled.value = True
131131
time.sleep(PAUSE)
132132

133-
#led = ev3.Led(name_pattern=LED_DEVICE)
134133
boardled.value = False
135134

136-
#btn = ev3.Button()
137-
138135
vllinit()
139-
#time.sleep(5)
140-
#print("sending MS_BEEP")
141-
#send(MS_BEEP)
142136

143137
def init_bluefruit():
144138
# Initialize the device and perform a factory reset
@@ -177,7 +171,6 @@ def check_connection(n_sec):
177171
### Note: read_packet looks a bit buggy
178172
### see https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI/issues/9
179173

180-
181174
### Nabbed off MUNNY code which may have been inspired by library examples directory
182175

183176
# Unlike most circuitpython code, this runs in two loops
@@ -219,17 +212,3 @@ def check_connection(n_sec):
219212
except RuntimeError as e:
220213
print(e) # Print what happened
221214
continue # retry!
222-
223-
224-
#pause()
225-
226-
#while True:
227-
# if btn.left:
228-
# send(MS_REV)
229-
# pause()
230-
# elif btn.right:
231-
# send(MS_FWD)
232-
# pause()
233-
# elif btn.up:
234-
# send(MS_BEEP)
235-
# pause()

0 commit comments

Comments
 (0)