A question about 16 bit ADC representation For a 16 bit ADC with a -10V to +10V analog input range I have read the following:  The resolution \$ \text{delta} = \dfrac{20V}{2^{16}} \$  16 bit 0000000000000000 corresponds to decimal 0 and this means the voltage read by the ADC is between -10V to -9 999.695V.  Similarly 16 bit 1111111111111111 corresponds to decimal 65535 and this means the voltage read by the ADC is between +9 999.695V to +10 000.  But I have couple of questions here where I get confused:  1-) If the ADC samples a voltage of +9 999V, will it register as 65535 or 65534?  2-) How about 32767 and 32768? Do they both represent OV? It seems to me 32767 is registered if the voltage is between -20/2^16V and 0V; and 32768 is registered if the voltage is between +20/2^16V and 0V. Is that correct. If so it means for 0V there are two steps unlike other voltage readings.  3-) Is the resolution \$ \dfrac{20V}{2^{16}} \$  or \$ \dfrac{20V}{2^{16}-1} \$?  EDIT:  I plotted in Python quantization of a sinusoid for a 3 bit ADC.  Which plot below represents better a 3-bit ADC converter quantizing a 10V 1Hz sinusoid input in this case sampled at 512Hz rate:  3 is the number of bits.  Below call it Plot 1, the number of levels are odd i.e (2^3)-1:     And below call it Plot 2, the number of levels are even i.e 2^3:    Which one above represents an ADC quantization better?  EDIT 2:  In response to Dirceu Rodrigues Jr and the transfer function he provided in his answer, I tried to plot it in Python (3 bit ADC for -10 to +10V input versus binary code in decimal):  import numpy as np import matplotlib.pyplot as plt  #ANALOG SIGNAL: va = np.linspace(-10, 10, 10000 ) #Analog input from -10V to +10V fs_p = 10.0 fs_n = -10.0   #DIGITAL OUTPUT CODE:  n=3 #ADC resolution  vd = ((va - fs_n) / (fs_p - fs_n)) * (2**n) #Transfer function vd = (vd).astype(int) #output code  plt.plot(va, vd,'.b') plt.plot(va, vd,'-g') plt.xlabel('Va (Analog input)') plt.ylabel('Vd (Output code)') plt.show() plt.grid()   Here is the output:
What value to use to convert ADC value to voltage? While working on my project, I got to a point where I don't know the answer. I have a 10-bit ADC (the one incorporated in the ATMEGA328P) and it returns values up to 1023 (210 - 1).   The official documentation states that the equation to convert the values from the ADC to the corresponding voltage is:   $$ V = \frac{V_{in} \cdot ADC}{2^{10}} $$  But, if the values go up to 1023, then wouldn't it be better to replace the 210 by 210&nbsp;-&nbsp;1?  Thanks.
Search for all files with a .sql extension in folders and sub folders Display of content-type I've got custom content-type with several groups and fields.   I want to change default display of that content-type. In which file can I find appropriate code? What's the meaning of a set to the power of another set? Java error: Implicit super constructor is undefined for default constructor Given a real, skew-symmetric matrix $\mathbf{A}\in\mathbb{R}^{m\times m}$, and a nonzero vector $X\in\mathbb{R}^{m}$, classify the scalar $\lambda$ (real, complex, imaginary, etc.) in the eigenvalue equation $$ \mathbf{A}X = \lambda X $$  The matrix $\mathbf{A}$ is skew symmetric if $\mathbf{A}^{T}=-\mathbf{A}$.  My try : I am new to matrices , so can not get a idea how to deal with it , Any hint will help Why do only two sexes exist for animals? How can I install .exe files of Windows 7 or more in Ubuntu? I want to run/install .exe files that require Windows 7 or higher in Wine on Ubuntu.   When I try to install a specific .exe file on Wine, it says      Windows version is not supported! You can install it in Windows 7 or higher.   How can I configure which Windows version (XP, Vista, 7, 8, ...) Wine emulates? Check out the below program.   try {     for (String data : Files.readAllLines(Paths.get("D:/sample.txt"))){         String[] de = data.split(";");         System.out.println("Length = " + de.length);     } } catch (IOException e) {     e.printStackTrace(); }   Sample.txt:   1;2;3;4 A;B;; a;b;c;   Output:   Length = 4 Length = 2 Length = 3   Why second and third output is giving 2 and 3 instead of 4. In sample.txt file, condition  for 2nd and 3rd line is should give newline(\n or enter) immediately after giving delimiter for the third field. Can anyone help me how to get length as 4 for 2nd and 3rd line without changing the condition of the sample.txt file and how to print the values of de[2] (throws  ArrayIndexOutOfBoundsException)? Hahn-Banach Theorem for separable spaces without Zorn's Lemma Is there an off/disable control anywhere? I realize that the INFO button toggles it off, but it comes right back on as soon as you tap the shutter, and that it a problem in low light situations where the LCD keeps blasting me in the eye. I accidentally changed /var owner/group to my username and then changed it back to root, but not all the /var folders' owners are root, so is there anyway to change back owner/group of files/folders to default state?  Or at least those files/folders that are created by packages? It is easily checked that $\displaystyle\sum_{i\ =\ 0}^{n}\left(\, -1\,\right)^{i} \binom{n}{i} = 0$, for example by appealing to the binomial theorem.  I'm trying to figure out what happens with the truncated sum $\displaystyle\sum_{i\ =\ 0}^{D}\left(\, -1\,\right)^{i}\binom{n}{i}$.  How far away from $0$ can this get, as a function of $D$ ?.  I'm mostly interested in the case of when $D \ll n$, such as $D \sim \,\sqrt{\,n\,}\,$.  Thanks ! I see these two expressions are used almost identically in different contexts. Is there a difference between I have got and I have gotten? $(X,\tau)$ needs to be $T_1$ in order to guarantee that $A'$ is closed? Claim: If $(X,\tau)$ is not $T_1$ then $A'$ is not necessarily closed for any $A$.  Proof: Here is an example. Take $X=\mathbb{N}$ and let $\tau=\lbrace u\subset\mathbb{N}\mid 1\in u\iff 2\in u\rbrace$. Let $A=\lbrace 2,3 \rbrace$. Since any open set containing $1$ also contains $2$ it follows that $1\in A'$. Hence $\overline{A}=\lbrace1,2,3\rbrace$, as it is the smallest closed set containing $A$. But  $X\setminus A'=\mathbb{N}\setminus\lbrace 1\rbrace$ is not open because it contains $2$ and not $1$. The set of accumulation points $A'$ is not closed.  So, in general, trying to prove that $A'$ is closed in a topological space is an effort in futility? I have to travel to Germany and Switzerland for business purpose. I have already been here 2 years ago. I have applied for business visa to the German consulate twice and both times the application got rejected. They have put a green stamp on the last page twice. The reason is the purpose and information submitted regarding intended stay is not reliable. I have submitted the documents to Swiss consulate and they have accepted and granted me a visa. Now I have to first travel to Germany and then to Switzerland.  So my question is, with a Schengen business visa granted by Switzerland, may I enter in Germany? Does the rejection stamp has any impact for entering at German airport ? Does it mean I cannot travel to Germany but to other Schengen countries ? Why do people have darker skin in sunnier climates? $d_1(x_1,y_1)$ and  $d_2(x_2,y_2)$ are metric on $X$ and $d(x,y)$ is defined as: $$d(x,y)= \sqrt{d_1(x_1,y_1)^2+d_2(x_2,y_2)^2}.$$ I am trying to show this is a metric. Can you give me some clue about proving the triangle inequality for $d$ ? Thank you for your help. RedirectMatch and Query String Compare these two RedirectMatch's. The first doesn't work: RedirectMatch 302 ^/redirect\.php[?]page=(.+)$ http://somewhereelse.com/$1  Versus this, which will redirect to http://somewhereelse.com/?page=wherever: RedirectMatch 302 ^/redirect\.php([?]page=.+)?$ http://somewhereelse.com/$1  Does RedirectMatch only match the URI and not the query string? Apache's documentation is a bit vague in this area. What I'm trying to do is extract the page query parameter and redirect to another site using it. Is that possible with RedirectMatch or do I have to use RewriteCond + RewriteRule? Why do we say that the Earth moves around the Sun? In history we are taught that the Catholic Church was wrong, because the Sun does not move around the Earth, instead the Earth moves around the Sun.  But then in physics we learn that movement is relative, and it depends on the reference point that we choose.  Wouldn't the Sun (and the whole universe) move around the Earth if I place my reference point on Earth?  Was movement considered absolute in physics back then? How to insert code with accents with listings? I'm trying to insert source code in LaTeX with using listings, but my code has accents and pdflatex gives me this error:  Unicode char \u8:�\expandafter not set up for use with LaTeX.   This is a code the reproduces the error.  example.tex  \documentclass{article} \usepackage{listings} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel}  \begin{document}  \lstinputlisting[language=C++]{code.cpp}  \end{document}   code.cpp  // Código con una tilde   What can I do to generate the PDF correctly?