Skip to main content
Associate
June 29, 2024
Question

Controlling a servo Motor over BLE

  • June 29, 2024
  • 2 replies
  • 1624 views

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!

2 replies

Andrew Neil
Super User
June 29, 2024

I am confused.

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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
KaiPAuthor
Associate
June 29, 2024

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 

Andrew Neil
Super User
June 29, 2024

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?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
June 29, 2024

@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.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
KaiPAuthor
Associate
June 29, 2024

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.