Phone:(705) 671-2652
    Fax:(705) 671-6127
   Email: tom@ontrak.net
Home Products Programming Applications Custom Designs Ordering News
    
Reading Potentiometer Position with Analog InputS

Before connecting a potentiometer to an analog input, the potentiometer must be biased with 5 volts. This is done by simply connecting 5 volts to one side of the pot and ground to the other. The wiper (center connection) of the pot is then connected to one of the analog inputs. To read the pot position an RDx command is sent to the ADR Interface . The interface will respond with position information represented by a digital number depending on the resolution of the analog input.

000 to 255 for 8-bit inputs ( ADR101)

0000 to 1023 for 10-bit inputs ( ADR2100)

0000 to 4095 for 12-bit inputs ( ADR2000A,ADR2000B,ADR2010)

00000 to 65535 for 16-bit inputs ( ADR7700 )

This sample BASIC program below reads the position of the two pots using an ADR101 and continually updates their position on the screen.

 7pot.gif (4746 bytes)

10 OPEN "COM1:9600,N,8,1,CS,DS,RS" AS#1
20 CLS
30 LOCATE 1,1
40 PRINT#1, "RD0"
50 INPUT#1, POT1
60 PRINT#1, "RD1"
70 INPUT#1, POT2
80 POT1=(POT1/255)*100 :PRINT "POT#1 IS AT"POT1, "PERCENT"
90 POT2=(POT2/255)*100 :PRINT "POT#2 IS AT"POT2, "PERCENT"
100 GOTO 40        

 

 Back to Applications Page

 
    
Contact Information
Address Telephone Electronic Mail
Ontrak Control Systems Inc.
764 Notre Dame Ave., Unit #1
Tel: (705) 671-2652 General Information Sales or Support
Sudbury,Ontario Fax:(705) 671-6127 tom@ontrak.net
CANADA P3A 2T2    
              
Next-Day shipping anywhere in Continental U.S. via Fed-Ex
Copyright 2012 ONTRAK CONTROL SYSTEMS 764 Notre Dame Ave, Unit #1 , Sudbury, Ontario, CANADA P3A 2T2  
"Quality serial Data Acquisition Interfaces"           PH. (705) 671-2652 FAX (705) 671-6127