<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="Bluefish 2.2.10" >
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Rotary encoder sample</title>
</head>
<body>
<p>The following code shows one way to read an incremental
mechanical rotary enoder (the sort used for volume control in audio
systems).&nbsp; These rotary encoders have two switches A and B
which return a quadrature output, i.e. they are 90 degrees out of
phase.