I am looking for a simple code that describes a simple circuit with a battery and two resistors(2,2 ohm and 4,7 ohm) and a voltmeter for the two resitors, can anyone help me?
\begin{figure}[h!]
\begin{centering}
\begin{circuitikz}
\draw (0,0) to[battery1] (0,5) to[short] (2,5) to[R=$R_1$] (2,3) to[voltmeter](2,3) -- (5,3) to [R=$R_2$](2,2) to[short] (2,0) to[short](0,0);
\end{circuitikz}
\caption{Elektrischemetingen (stroom)}
\end{centering}
\end{figure}
\centering
is not an environment, so it should be\begin{figure}\centering...
not\begin{figure}\begin{centering}...
. Also a minimal code example should be compilable, so start with\documentclass
and end with\end{document}
, loading the necessary packages you'll need.