ICOM-241
'--------------------------------------------------------------------
'----- ICOM200_AD.TIG
'--------------------------------------------------------------------
#include define_a.inc
user_var_strict
TASK Main
BYTE k
ARRAY Value(4) OF WORD
DIR_PORT 8,0
DIR_PORT 7,0
INSTALL_DEVICE #lcd,"LCD2.TDD",0,0,0EEH,1,150,11H' LCD-1=128x64, 150
KB/s 3
INSTALL_DEVICE #4, "ANALOG1.TDD" ' Analog-Inputs installieren
OUT 8,11111111b,11011111b ' set CTRL-Pins of T6963C
OUT 8,10000000b,255
LOOP 99999
FOR K = 0 TO 3 ' 4 Kanaele
GET #4, #K, 2, Value(K) ' Wert aus AD-Wandler lesen
NEXT ' naechster Kanal
PRINT #lcd, "<1>"; ' Bildschirm loeschen
FOR K = 0 TO 3 ' 4 Kanaele
PRINT #lcd, "AD"; K; ":"; ' Kanal-Nr. anzeigen
PRINT #lcd, Value(K) ' Wert auf LC-Display ausgeben
NEXT ' naechster Kanal
WAIT_DURATION 100 ' 100 ms warten
ENDLOOP
END