You want to use a math formula. In order to do this, you should
- define a higher level commands for the variables;
- define a math symbol for plus-equal, which should have the two parts next to each other;
- use properly the underscore.
\documentclass{article}
\usepackage{amsmath} % not necessary for the example, but recommended
\newcommand{\lvar}[1]{\mathit{#1}}
\newcommand{\pluseq}{\mathrel+=}
\begin{document}
$\lvar{opvalue} \pluseq \lvar{analogRead(aop_measure)}$
\end{document}
If you later change your mind, you can decide that the argument to \lvar is typeset upright, boldface or whatever by just changing the definition.
With \mathrel+= we make the whole combination a relation symbol, which seems the appropriate choice. TeX will never add space between consecutive relation symbol, nor break a line in the middle.

\_. That's because underscore is designed to be used in math mode to display subscript. – SolidMark Jun 26 '21 at 15:50