You cannot have numbers in macro names (at least not without some trickery).
The following works fine:
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\newcommand\opampfive[5]
{
\begin{circuitikz}
\draw (0,0) node[op amp] (opamp) {};
\draw (-2,-0.49) to[short, o-] (opamp.+) (-2.2,-0.49) node[anchor=east] {${#1}$};
\draw (-2,0.49) to[short, o-] (opamp.-) (-2.2,0.49) node[anchor=east] {${#2}$};
\draw (-0.08,1.5) to[short, o-] (opamp.up) (-0.08,1.6) node[anchor=south] {${#3}$};
\draw (-0.08,-1.5) to[short, o-] (opamp.down) (-0.08,-1.6) node[anchor=north] {${#5}$};
\draw (1,0) to[short, -o] (2,0) -- (opamp.out) (2.1,0) node[anchor=west] {${#4}$};
\end{circuitikz}
}
\opampfive{1}{2}{3}{4}{5}
\end{document}
To add arrows representing the current flowing through resistors you just have to follow the package guide in which there are some examples about this problem in section 4.2 Currents.
Thus, the example becomes:
\documentclass{article}
\usepackage[american,siunitx]{circuitikz}
\begin{document}
\begin{circuitikz}[x=1.5cm,y=1.2cm]
\draw (0,0) to[battery, l=12<\volt>] (0,2) -- (0,3.5)
to[R,l=4<\ohm>,i_=$I_1$] (4,3.5) -- (4,2)
(0,0) -- (4,0) to[battery, l=24<\volt>,i>] (4,2)
(0,2) to[R, l=2<\ohm>, *-*,i_=$I_2$] (2,2)
to[R, l=3<\ohm>, -*,i<_=$I_3$] (4,2)
(2,0) to[R, l=2.5<\ohm>, *-,i<_=$I_4$] (2,2);
\end{circuitikz}
\end{document}
The result:
P.S. The current direction might be wrong ;)
Best Answer
Yes, name the potentiometer (using the
n
key) and use thewiper
anchor; for example: