The definition you give has two spaces that you should remove
\newcommand{\icpin}[2]{\setlength{\fboxsep}{0pt} \fbox{\texttt{\colorbox{lgray}{\strut{}\,PIN~#1\,}\,#2\,}} \setlength{\fboxsep}{2pt}}
^ ^
Here's a properly formatted one, with some changes:
\newcommand{\icpin}[2]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\fbox{%
\ttfamily
\colorbox{lgray}{\strut\,PIN~#1\,}\,#2\,%
}%
\endgroup
}
The group makes the settIng to \fboxsep local to it, so you don't need to explicitly reset it. Using \ttfamily avoids a further pair of braces: the group will limit the effect of this declaration.
Full code:
\documentclass{article}
\usepackage{xcolor}
\definecolor{lgray}{gray}{0.7}
\newcommand{\icpin}[2]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\fbox{%
\ttfamily
\colorbox{lgray}{\strut\,PIN~#1\,}\,#2\,%
}%
\endgroup
}
\begin{document}
You can similarly enable the third and fourth channel
by giving \texttt{HIGH} input to \icpin{9}{EN3,4}.
\end{document}

Perhaps you should add also thin spaces at either end.
\documentclass{article}
\usepackage{xcolor}
\definecolor{lgray}{gray}{0.7}
\newcommand{\icpin}[2]{%
\begingroup
\setlength{\fboxsep}{0pt}%
\leavevmode\,% <-- don't forget \leavevmode
\fbox{%
\ttfamily
\colorbox{lgray}{\strut\,PIN~#1\,}\,#2\,%
}%
\,%
\endgroup
}
\begin{document}
You can similarly enable the third and fourth channel
by giving \texttt{HIGH} input to \icpin{9}{EN3,4}.
\end{document}

\setlength. Also, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the\documentclassand the appropriate packages so that those trying to help don't have to recreate it. Oh, you also have a\,at the end which probably needs to be removed. – Peter Grill Jul 28 '16 at 05:19