0

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}
5
  • Welcome to TeX.SX! Please help us help you by providing a minimal code example of what you've tried so far (MWE). While the documentation is quite demanding you will find many examples on this site to start with.
    – TeXnician
    Commented Oct 27, 2018 at 20:13
  • Yes I already looked but I dont get the system with the coordinates, I already searched but didn't find anything I realy understand.
    – Peter17
    Commented Oct 27, 2018 at 20:19
  • This is what I tried already:
    – Peter17
    Commented Oct 27, 2018 at 20:20
  • \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}
    – Peter17
    Commented Oct 27, 2018 at 20:20
  • 1
    You should've edited your question to include the code there (as I did now). \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.
    – Skillmon
    Commented Oct 27, 2018 at 20:24

1 Answer 1

2
\documentclass[border=2mm]{standalone}

\usepackage{circuitikz}

\begin{document}
\begin{circuitikz}
  \draw (0,0) coordinate(a) to[battery1] (0,4) to[short] ++(2,0)
    coordinate(b) to[R=$R_1$] ++(0,-2) coordinate(c) to[R=$R_2$] (c|-a)
    to[short] (a);
  \draw (b) to[short,*-] ++(2,0) coordinate(e) to[voltmeter] (e|-c)
    to[short,*-*] (c);
  \draw (e|-c) to[voltmeter] (e|-a) to[short,-*] (c|-a);
\end{circuitikz}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .