ARDUINOxBLUETOOTHxPROCESSINGxBLUEFRUIT

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tamaravirag
 
Posts: 2
Joined: Wed Dec 27, 2017 4:31 am

ARDUINOxBLUETOOTHxPROCESSINGxBLUEFRUIT

Post by tamaravirag »

BluetoothxArduinoxProcessing
BluetoothxArduinoxProcessing
Screen Shot 2017-12-27 at 09.42.07.png (217.14 KiB) Viewed 302 times
Hi guys,

I was wondering if anyone has already found a library/come up with one / or an idea for connecting two adafruit feathers (32u4) through bluetooth? I've read a bit about central and peripheral mode in bluetooth, and so I know it's not yet possible to connect them both unless using the computer/app/mobile's bluetooth.

I have 2 feathers:
- Bluetooth connected: feather 1 is linked to an encoder and sends data to the computer (this I've managed to do already with the adafruit bluefruit le connect app)
- USB connected: feather 2 makes a motor run if the encoder is used

So basically, if the encoder is telling the computer that it is "turning", the computer will send a signal to feather 2 and the motor will be activated.
I know it's possible to connect processing to arduino through USB (https://learn.sparkfun.com/tutorials/co ... processing) but i was wondering if anyone knew how to get a bluetooth connexion between a feather and processing.

Also, I have to warn you that I am very very novice at electronics and coding, so please bear with me and my lack of knowledge.

I hope I was clear, thank you so much if you take the time to read this, it would literally save my life if you could suggest anything!

Wishing you a nice week,

t

User avatar
bigwheels
 
Posts: 13
Joined: Sun Dec 17, 2017 11:30 pm

Re: ARDUINOxBLUETOOTHxPROCESSINGxBLUEFRUIT

Post by bigwheels »

A few thoughts:

1. If the encoder and the motor are in close proximity to each other, you might be able to do all the processing you need on one 32u4. But depends on the processing required, and if user input is needed via the computer to do the processing...

2. The adafruit nRF52 can be a central, or a peripheral. So two of them could talk to each other over BLE. But I assume you don't want to buy two new boards, so...

3. Yes - its possible to connect your computer (I assume this is what you mean when you say "processing"?) to a 32u4 via BLE. You have to set up a BLE service on the 32u4 with a "write" characteristic, and then you can write to that characteristic using your computer.

For example, I use an iPhone to connect to an nRF52 via BLE, and write data to the board. The nRF52 then takes that data, and uses it to switch on/switch off/adjust various electrical devices.

The details of how to do all of this can get quite involved, and depend on what you want to accomplish in your processing step. But its certainly possible to do.

User avatar
tamaravirag
 
Posts: 2
Joined: Wed Dec 27, 2017 4:31 am

Re: ARDUINOxBLUETOOTHxPROCESSINGxBLUEFRUIT

Post by tamaravirag »

Hi @bigwheels, thank you so much for your reply :-)

I've managed to tackle the issue by switching to Huzzah feathers, and using websockets, so I got what I wanted to do, but to answer you:

1) I couldn't have gotten the two objects close together because the actual project is for connecting a jumping rope to an orange pressing machine actually, (- yeah, it's really messed up I know, art school things I guess-), so that would've been impossible.

2) Yes, I realised that after reading through internet forums, I feel kind of depressed when I think about it...I wish my teachers had told me that before.

3) I meant Processing as in https://processing.org/ actually, because I knew the data was accessible from the BLE connect app- so how they did it was accessible in the github source code-, but since I can't code in Swift I was searching for something simpler in Java through Processing.
Setting up a BLE service on the 32u4 and then writing to it is probably the best solution, thank you for sharing your knowledge, I'll give it a try when I finish my exams!

Thank you again, and I wish you a nice day/week :-) !

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”