0

Adafruit BLE Volume Control Knob Project
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit BLE Volume Control Knob Project

by mroxner on Thu Mar 04, 2021 2:03 pm

Hello,

We have been working on a project from a guide on your website. Using the Circuit Playground Bluefruit. Using the linked guide we connected all of the hardware, plugged the Bluefruit into two different computers, used the recommended text editor, and the code included in the guide.

We were not able to get the code to run. We double checked the hardware components and then looked into the Bluefruit. Other codes worked fine with the Bluefruit and executed other programs successfully. When we went back to our other code that was supplied in the guide, it still didn't work.

We are not advanced enough to look over the code ourselves but we suspect there is something outdated or a software update we are missing with the Bluefruit.

Thanks in advance,
Caleb and Ephraim

(Caleb and Ephraim are students. Mr. Bryan Oechsner is the teacher)

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Fri Mar 05, 2021 6:07 pm

Just to be sure, you're following this guide?
https://learn.adafruit.com/bluetooth-le ... cuitpython

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Tue Mar 09, 2021 9:25 am

Yes. That's the guide we are using.

Please advise.

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Tue Mar 09, 2021 11:05 am

Can you provide more information on what "not running" means? Are you getting error messages?

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Tue Mar 09, 2021 11:31 am

Thank you for your quick reply. I will have my two students reply with more detailed information tomorrow morning during class (740AM-840AM CST).

Best,
Bryan Oechsner

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Tue Mar 09, 2021 11:40 am

OK, thanks. Please also provide general information on the setup. Like what software is being used (Mu?), how you're connecting to the CPBs, etc. That'll help us provide more specific information on where and what to look for.

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Wed Mar 10, 2021 10:52 am

For the project, we copied and pasted the code into MU circutpython. We connected our Circuit Playground Bluefruit to the computer with a usb to microusb cable. We then saved the code onto the CPB through MU, which we thought was the last step. However, the CPB never began broadcasting via bluetooth. We never got any error messages, but only observed that the device was not doing what the program said it should be doing.

Here are some pictures of the hardware components:

All components: https://drive.google.com/file/d/1tlvNs7SaGmDcn36HX4puzP51Auqpn8KF/view?usp=sharing

Breadboard: https://drive.google.com/file/d/1td8XaK ... sp=sharing

CPB:

https://drive.google.com/file/d/1tldlVG ... sp=sharing

Code:

https://drive.google.com/file/d/1wIz2Nx ... sp=sharing

Any suggestions would be very helpful!

Thank you,

Caleb and Ephraim
Attachments
BLE_2.jpg
BLE_2.jpg (311.9 KiB) Viewed 2498 times
BLE_1.jpg
BLE_1.jpg (469.41 KiB) Viewed 2498 times
MU.PNG
MU.PNG (138.68 KiB) Viewed 2498 times

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Wed Mar 10, 2021 10:53 am

Here is the last image attachment.
Attachments
BLE_3.jpg
BLE_3.jpg (512.57 KiB) Viewed 2498 times

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Wed Mar 10, 2021 11:45 am

Thanks for all the info. I'll look through this and see if I can spot anything.

One thing to try real quick - Click the "Serial" button in the toolbar menu to open the Serial window. That will show any output from print() statements in the code. The code prints "let's go" before starting the BLE stuff:
Code: Select all | TOGGLE FULL SIZE
print("let's go!")

Make sure you are seeing that in the Serial window. That'll verify that the code is at least running.

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Mon Mar 15, 2021 1:19 pm

We tried the serial connection as you suggested and the CPB gave this feedback:


code.py output:

Traceback (most recent call last):

File “code.py”, line 38, in <module>

TypeError: function missing required positional argument #3


Code done running


Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Circuit Playground Bluefruit with nRF52840

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Mon Mar 15, 2021 1:57 pm

OK, being able to see the error message helps. Your screen shot cuts off your code, so can't see exactly what your line 38 is. But if it's exactly the same as the Learn Guide code, then it should be this:
Code: Select all | TOGGLE FULL SIZE
ring = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.05, auto_write = False)

Is that what your code.py line 38 is?

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Tue Mar 16, 2021 10:11 am

Yes, the line 38 of our code matches the Learn Guide which is the same as the line of code you typed out.
Attachments
line 38 code.PNG
line 38 code.PNG (105.49 KiB) Viewed 2448 times

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Tue Mar 16, 2021 10:27 am

How did you copy the NeoPixel library file (neopixel.mpy) to your CIRCUITPY folder?

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit BLE Volume Control Knob Project

by mroxner on Wed Mar 17, 2021 10:45 am

To copy NeoPixel to our CIRCUIPY device we first downloaded the adafruit circuit python bundle version 6.x. After downloading the file, we unzipped the file so that we could access the individual files. We dragged the NeoPixel.mpy file from the library bundle to the library folder of our CIRCUIPY device to copy the file.


https://drive.google.com/file/d/1C0z3aXMkF2dnVnx6tEelu6c4xz4tD-Hu/view?usp=sharing
Attachments
library.PNG
library.PNG (133.56 KiB) Viewed 2436 times

mroxner
 
Posts: 8
Joined: Wed Mar 03, 2021 12:08 pm

Re: Adafruit BLE Volume Control Knob Project

by adafruit_support_carter on Wed Mar 17, 2021 12:32 pm

Thanks. That sounds correct. It's acting like maybe it's confusing the library modules somehow. Try deleting neopixel.mpy and neopixel_spi.mpy from your CIRCUITPY folder. Then, copy *only* neopixel.mpy from the library bundle zip to your CIRCUITPY folder.

neopixel_spi.mpy is something else and you do not need it.

adafruit_support_carter
 
Posts: 20354
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.