Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

ADC to radio to PC, int (int16) to char (uint8) and back to int (int16) conversion?

$
0
0

Hi,

I am trying to write a code to ADC a sine wave and then radio it to a cc2511 dongle acting as a serial port to a PC, so that I can plot and re-create the sine wave at the PC. Now I am really getting confused by the char and int type of data along the way.

After the 12-bit ADC conversion, essentially it ends up with 2 bytes of data, but the radio only take char (uint8) type of data. So I guess the output from the ADC needs to be converted into a char type of data before the radio.

At the radio receiver end, the char type of data is sent to the PC by UART, obviously the char type of data can not be plotted to re-create the sine wave. So I guess I need to use the atoi() function to convert char back to int somewhere along the way, am I correct?

Thanks!


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>