Instructions
228Libraries
© 2013 Conrad Electronic
AC_AC0AN0
P20
1
in_neg
-
AC_AC0BP0
P21
2
in_neg
-
AC_AC1AP0
P25
0
-
in_pos
AC_AC1AP1
P11
1
-
in_pos
AC_AC1AN0
P24
2
-
in_neg
AC_AC1AN1
P12
3
-
in_neg
AC_AC1BP0
P26
4
-
in_neg
AC_AC1BP1
P13
5
-
in_neg
5.3.2.3 AC_InpHigher
Analog Compare Functions Example
Syntax
byte AC_InpHigher(byte ctrl);
Sub AC_Disable(ctrl As Byte) As Byte;
Description
Returns whether the voltage of in_pos is greater than the voltage of in_neg.
Parameter
ctrl Analog Comparator (0 - 1)
Return Parameter
Not zero, if in_pos is greater than in_neg.
5.3.2.4 AC Example
// AVR32Bit Analog Comparator Example
void main(void)
{
AC_Enable(0, AC_AC0AP0, AC_AC0AN0);
while(1)
{
if(AC_InpHigher(0)) Msg_WriteText("AC_AC0AP0 > AC_AC0AN0\r");
else Msg_WriteText("AC_AC0AP0 < AC_AC0AN0\r");
AbsDelay(500); // 500ms delay
}
}