cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a servo Motor over BLE

KaiP
Associate II

Hi there, I'm trying to do a project that involves controlling a servo motor over the BLE I have a STM32wb15, i know my configuration is set up correct as I have copied a code from an example I have and the project works exactly as it should.

My problem is the coding i have a very basic knowledge of programming(bit of a beginner) and what i need is to control a servo motor over a android app over Bluetooth using a slider to control the motor i have a very basic app set up which has a slider and a button-which is supposed to connect to the device

So if anyone is able to help that would be very much appreciated!

6 REPLIES 6
Andrew Neil
Evangelist III

I am confused.

You say you already have project that's working fine - so what is it that you actually need help with?

hi sorry Andrew I probably didn't explain to well, i have a project that proves my configuration is correct with starting the on board Bluetooth its the new project i need help with its the coding i struggle with, as mentioned i need to control a servo motor on a slider on an app i have created on android, 

thank you 

Still no idea!

 


@KaiP wrote:

I have copied a code from an example I have and the project works exactly as it should.


So you already have a working project?

Unfortunately not the project I have a project that only activates the Bluetooth so i can talk to the st board, what i was saying was i can copy the code from that project into a new project and it works which means my configuration is set up correct, its just the code I'm having a trouble with.

Andrew Neil
Evangelist III

@KaiP wrote:

My problem is the coding i have a very basic knowledge of programming (bit of a beginner) 


So start with the basics - don't leap straight in to such an advanced project!

https://www.avrfreaks.net/s/topic/a5C3l000000UYGFEA4/t145493?comment=P-1392529

Basic  steps:

  1.  Write some code to blink an LED connected to a pin.
  2. Learn how to use your debugger to step through your simple LED code, look at your variables, etc
  3. Learn to use the UART to transmit a fixed "Hello, World " string. Again, practice using the debugger with it.
  4. Adapt your code to be able to send a variable string. This will be invaluable for future work! Keep practicing with that debugger...
  5. Adapt your code to be able to receive on the UART

That will give you basic skills to write & debug code.

The next step would be to do the servo control without BLE - keep things simple, doing one step at a time.

Once you have your "standalone" servo code working you will know what commands/controls it needs - so you can move on to adding them via BLE.

Again, start with just the BLE code - without the servo part.

Finally, bring it all together.

 

thank you very much Andrew i shall keep practicing i have been able to control leds over ble before and do have basic projects of controlling servo and stepper motors its just implementing the both together but i shall keep learning and trying.