top01.jpg (17169 bytes)
mleft.jpg (4986 bytes) m01a.jpg (6169 bytes)     m02a.jpg (6905 bytes)     m03a.jpg (7743 bytes)    m04a.jpg (7456 bytes)     m05a.jpg (7878 bytes)     m06a.jpg (6862 bytes)     m07a.jpg (6076 bytes) mright01.jpg (5078 bytes)

Driving LED's With Digital I/O Lines

LED's may be driven by digital I/O lines and require only a current limit resistor to limit current to 20mA or less. Digital I/O lines can source ( LED 1) or sink ( LED2)   LED current. If the I/O line is to sink LED current, the "RESPAn" command is used to turn the LED on and the "SETPAn" command is used to turn the LED off.. If the I/O line is to source LED current, the "SETPAn" command is used to turn the LED on and the "RESPAn" command is used to turn the LED off. The following example shows the use of an101sWEB.jpg (2923 bytes)ADR101 to control two LED's in each of the before mentioned configurations.

LED.gif (16946 bytes)

10 OPEN "COM1:9600,N,8,1,CS,DS,RS" AS#1
20 PRINT#1, "CPA11111100"
30 REM TURN ON LED#1
40 PRINT#1, "SETPA0"
50 REM TURN OFF LED#1
60 PRINT#1, "RESPA0"
70 REM TURN OFF LED#2
80 PRINT#1, "SETPA1"
90 REM TURN ON LED#2
100 PRINT#1, "RESPA1"
110 BEEP
120 GOTO 30          

 Back to Applications Page

NEWS         PRODUCTS         PROGRAMMING          APPLICATIONS          CUSTOM DESIGN          ORDERING          HOME


TestPoint is a trademark of Capital Equipment Corp.   
LabVIEW is a trademark of National Instruments.
Visual BASIC is a trademark of Microsoft Corporation


Copyright © 1999 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