This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

reading +-3.3 v with ads7813

I need help immediately with ads7813.

i use arduino with  ads7813.

no problem about connections, i just need a code that reads data from adc and convert it to correct values.

so i need to fix these codes:

 

//below x[0] is msb bit 

if(x[0]=1){
for(int j=1, c=16384;j<16;j++,c=c/2)
 { 
x[j]=~x[j];
val+=c*x[j]; }
val=-val;
}
else{
for(int j=1, c=16384;j<16;j++,c=c/2){
val+=x[j]*c;
} }