spusuluri / BME590-Final-Project

This repository holds C code for BME 590 Final Project
0 stars 0 forks source link

Error with sending RMS values via BLE #3

Closed spusuluri closed 1 year ago

spusuluri commented 1 year ago

EDIT: I think I got a 10-byte array but don't know how to read it. This is for when 100 Hz sinusoid has 40 mVpp and 500 Hz sinusoid has 80 mVpp

I get this value: 0x2C490020000000003C4A transmitted. How do I read this and know if I have the right numbers. The log shows me that the Array is transmitting the numbers in this order from 0-9

[00:00:18.161,834] <dbg> Final_Project: board_button1_callback: Button 1 pressed.
[00:00:19.161,865] <dbg> Final_Project: collect_rms_data: RMS Data Collected
[00:00:20.161,834] <dbg> Final_Project: collect_rms_data: RMS Data Collected
[00:00:21.161,834] <dbg> Final_Project: collect_rms_data: RMS Data Collected
[00:00:22.161,834] <dbg> Final_Project: collect_rms_data: RMS Data Collected
[00:00:23.161,865] <dbg> Final_Project: collect_rms_data: RMS Data Collected
[00:00:23.161,895] <dbg> Final_Project: stop_rms_data: RMS Data Stopped
[00:00:28.160,156] <dbg> Final_Project: board_button2_callback: Array Value: 28
[00:00:28.160,156] <dbg> Final_Project: board_button2_callback: Array Value: 57
[00:00:28.160,186] <dbg> Final_Project: board_button2_callback: Array Value: 28
[00:00:28.160,186] <dbg> Final_Project: board_button2_callback: Array Value: 54
[00:00:28.160,217] <dbg> Final_Project: board_button2_callback: Array Value: 28
[00:00:28.160,217] <dbg> Final_Project: board_button2_callback: Array Value: 58
[00:00:28.160,247] <dbg> Final_Project: board_button2_callback: Array Value: 28
[00:00:28.160,247] <dbg> Final_Project: board_button2_callback: Array Value: 56
[00:00:28.160,247] <dbg> Final_Project: board_button2_callback: Array Value: 28
[00:00:28.160,278] <dbg> Final_Project: board_button2_callback: Array Value: 57
[00:00:28.160,369] <inf> Final_Project: BT data transmitted.
spusuluri commented 1 year ago

I believe that there is still an error with transmitting the data because there is no symmetry with the value (representation of 28 should be there many times). I can't seem to pinpoint the error.

Also, my DC ADC channel can only read up to about 3.1 V but once it reaches 3.2 V it is incorrect. Tried different gains. Is there a way to get to 3.7 V. I tried using VDD_1_4 and vref_mV=750 but didn't seem to help. Any suggestions?

spusuluri commented 1 year ago

Fixed issue. It seems that I forgot to set_data.