I want to send data without a computer from 3 ADC sensors.
using de ble uart.
How do I set my variable to send data?
I should use in ble_nus_string_send(&m_nus, data_array, index);?
Thank you
I want to send data without a computer from 3 ADC sensors.
using de ble uart.
How do I set my variable to send data?
I should use in ble_nus_string_send(&m_nus, data_array, index);?
Thank you
Are you trying to use two UARTs? The nRF51422 (and nRF51822) has one UART. Please see this. You can use ble_nus_string_send(). Is the nRF51422 able to receive the data from the sensors?
Hello and thank you. de Example code Working good. I do not need the side of the computer. I would like to receive light sensor data and send them Using de BLE Uart. i use de Uart As platform for communication.
So you will read your sensors with SPI or TWI and eventually you will be ready to send the data you collected. This data will be sent over uart using
err_code = ble_nus_string_send(&m_nus, data_array, index);
Here m_nus is the structure to identify the Nordic UART Service. This is important but you shouldn't have to touch it as it has been initialized in the example code.
All you need to do is make sure the data you want to send is correctly stored in data_array. (Also note that the maximum number of data bytes you can send is 20 bytes at a time using ble_nus_string_send, unless you implement ble long write).
index will be the number of bytes you are sending in this packet. So if you are sending 10 bytes of data (maybe 5 sensor readings) then index will equal 10.
You shouldn't have to mess with the ble_uart example code much at all to get this working. Just look at the contents of this function /**@snippet [Handling the data received over UART] */ void uart_event_handle(app_uart_evt_t * p_event) where the send data over ble_uart.
and this function /**@snippet [Handling the data received over BLE] */ static void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length) where they receive data over ble_uart