Interlink-electronics Ring Sensor Manual de usuario Pagina 11

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 14
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 10
www.interlinkelectronics.com
9
Ring Sensor
Integration Guide
Calculating the Touch Angle from Vtheta
The voltage Vtheta was measured by applying 256 counts over an angle of 240°. Voltage can
therefore be converted to angle by multiplying by 240/256. Conveniently, 240/256 reduces to the
ratio 15/16. If the touch was in zone 1, 120° must be added to the angle. If the touch was in zone 2,
240° must be added to the angle. And if the touch was in zone 3, no offset is required. Finally, the
result should be checked to see if it exceeds 359°. The following code example shows the complete
conversion of Vtheta to angle theta:
theta=(v_theta*15)/16; //convert from voltage to angle
if(1==zone) //Add necessary offsets
theta+=120;
else if (2==zone)
theta+=240;
else if (3==zone)
theta+=0;
if(theta>359) //sanity check angle
theta-=360;
Vista de pagina 10
1 2 ... 6 7 8 9 10 11 12 13 14

Comentarios a estos manuales

Sin comentarios