What is the Arduino Simulink BLE data transmission frequency using matlab block and ble() function
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello!
I am using Matlab block in Matlab Simulink to connect, send and receive data between my laptop and 3 Arduino Nano BLE devices.
Within the matlab block I use:
- blelist and ble('devicename') to search and connect to the device
- Characteristic(device name,"ServiceUUID", "CharacteristicUUID")
- Convert the received data from Byte format to double double(typecast(uint8(read(Received data structure)), 'uint32'))
The connection works well and is stable etc. however when I plot the data I can only get it to receive data every 3 seconds.
I already tried to change the simulink time step settings etc without success.
My question: How can I receive data at a higher frequency? Am I making any obvious error?
Many thanks in advance
5 comentarios
Walter Roberson
el 12 de Jun. de 2022
You should move the setting of characteristics to inside the if isempty() . Outside of the isempty() should be reserved for making changes to setting or reading or writing from the device.
If you need to read an indefinite number of times after each write (perhaps the writes are triggered or due to user input), then you should split the function into a read function and a write function. In that situation you would probably convert from persistent variable to global variable in a Data Store, and probably use an initFcn() callback to trigger initialization of the ble object.
Respuestas (0)
Ver también
Categorías
Más información sobre Modeling en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!