How can I add a new service or characteristics to my bluetooth aplication?
what I'm trying to acomplish is read a sensor(ADC, I2C) and/or to modify the duty cycle of the PWM through an app but I can't find the information to create characteristics and how to modify it remotly or local
And since It's not recomended to modify the main loop how can I setup a periodical reading? using a timer?, I know the bluetooth works with events but I can't find a way to make it works
for example:
I need to read a temperature sensor every 2min and modify the Duty cicle of my pwm acording to the temperature but I also would like to connect to the bluetooth and read the actual temperature or modify the duty cycle via smartphone
I Have no problem with the peripherals I know how to use them since I been working with the peripheral examples but now I don't know how to add them to my bluetooth aplication.
嗨magergar,
The ble_app_petipheral example of the SDK can be taken as a reference. Please check out app_adcval1_timer_cb_handler() in order to understand how to send notifications to the peer device. The specific example is under projects\target_apps\ble_examples\ble_app_peripheral path.
Please check out theDA14531-DA14585-586 Reading I2C Accelerometer BLESW Example. That example is using BLE notifications in order to send data to a peer device.
You can also take a look at the CodeLess example and you will find detailed examples in the user guide.
//www.wsdof.com/products/smartbond-codeless-commands
I would recommend also checking the following tutorials :
http://lpccs-docs.dialog-semiconductor.com/DA145xx_Advertising_Tutorial/index.html
http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/index.html
http://lpccs-docs.dialog-semiconductor.com/tutorial-custom-profile-DA145xx/index.html
Thanks, PM_Dialog