The sample code for retrieving and setting DI and DO is as follows.
Do3=GetDo3(); /* Read the state of DO3 */
Print("DO3=%s\n\r", Do3?"High":"Low");
if(!Do3)
SetDo3High(); /* Set the DO3 to ON */
else
SetDo3Low(); /* Set the DO3 to OFF */
InitLib(); /* Initiate the 7188xc library */
Print("DI=%s\n\r", GetDi2()?"High":"Low"); /* Read the state of DI2 */
Print("DI=%s\n\r", GetDi3()?"High":"Low"); /* Read the state of DI3 */
Do1=GetDo1(); /* Read the state of DO1 */
Print("DO1=%s\n\r", Do1?"High":"Low");
if(!Do1)
SetDo1High(); /* Set the DO1 to ON */
else
SetDo1Low(); /* Set the DO1 to OFF */
Do2=GetDo2(); /* Read the state of DO2 */
Print("DO2=%s\n\r", Do2?"High":"Low");
if(!Do2)
SetDo2High(); /* Set the DO2 to ON */
else
SetDo2Low(); /* Set the DO2 to OFF */
int Do1, Do2, Do3;
Refer to the demo programs in the
CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\IO_Pin folder for more
information.
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
68
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...