This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_UART example +spi

hi, i am new to embedded system. I am using SPI interface to collect data from the slave(imu) and transmitted it to nrf52 DK,previously,I just used RTT to show the received data, now i try to use uart and ble to build communication between PC and smartphone to show the data in both smartphone and PC. here, i used ble-app-uart example and add spi function into the example. firstly i want to test whether the uart can work properly, so i just use printf() to show the data in tera term, but the received data is all 0. actually i used RTT(not uart) to show the data before, and the received data is correct. Could you help me find the problem. image description main1.c

Parents
  • So other than switching from RTT to UART your new code is exactly the same? And you have not reconfigured the hardware in anyway? My first thought was that you had some issues with casting float variables to integers. However, I tested your code with some dummy data in the accreal_xyz() and accRD_XYZ() functions and it still printed out decimal values on my terminal. BTW: in case you didn't know you can use '\r' (carriage return) in addition to '\n' (new line) to get the values to print nicely underneath each other.

Reply
  • So other than switching from RTT to UART your new code is exactly the same? And you have not reconfigured the hardware in anyway? My first thought was that you had some issues with casting float variables to integers. However, I tested your code with some dummy data in the accreal_xyz() and accRD_XYZ() functions and it still printed out decimal values on my terminal. BTW: in case you didn't know you can use '\r' (carriage return) in addition to '\n' (new line) to get the values to print nicely underneath each other.

Children
No Data
Related