I am reading an ADC Input by Microcontroller form AC realy, I have to store them to represent sign wave. when I read peak value, which is active High, I am reading 12 bit ADC value is 4090 (actually 4096, but some drop is there), sometimes I get 4086. the low I gets zero and middle I gets 2044 or 2040. Here
active high: 4094
middle: 2048.
active low : 0
I have make middle as centre point and I have to store 2048 as zero and active low as negative 1 and active high as 4094. how can I do in C language to store them, do I have to divide or modulus?. I am taking 1000 samples per Second, using all these samples, these samples I have to store between -1 and +1, can somebody through how can I store (when I read I get svalues between 0 and 4094 and I have to store them between -1 and +1). appreciated.
active high: 4094
middle: 2048.
active low : 0
I have make middle as centre point and I have to store 2048 as zero and active low as negative 1 and active high as 4094. how can I do in C language to store them, do I have to divide or modulus?. I am taking 1000 samples per Second, using all these samples, these samples I have to store between -1 and +1, can somebody through how can I store (when I read I get svalues between 0 and 4094 and I have to store them between -1 and +1). appreciated.
Comment