Analog Inputs and Outputs
Set_Mux2
ADwin
72
ADwin-Gold II
, Manual February 2013
Example
To set the multiplexer of ADC2 to channel 10 and gain 2, you need the
bit pattern:
01100b
(decimal:
12
).
Rem Please select the appropriate include for ADbasic /
TiCoBasic
#Include
ADwinGoldII.inc
'for ADbasic
Rem #Include GoldIITiCo.inc 'for TiCoBasic
Dim
val
As
Long
Event:
Set_Mux2
(
01100b
)
'Set multiplexer 2: channel and gain
Rem interrupt IO access for MUX settling time
IO_Sleep
(
200
)
Rem use waiting time, except for access to IOs or external
memory
Rem …
Start_Conv
(
2
)
'Start AD-conversion ADC2
Wait_EOC
(
2
)
'Wait for end of conversion of
'ADC2
val
=
Read_ADC
(
2
)
'Read value of ADC2