Moxa DA-682A-C7-W7E Инструкция по эксплуатации онлайн [52/53] 170432

Moxa DA-682A-C7-W7E Инструкция по эксплуатации онлайн [52/53] 170432
DA-682A Win7 Software Sample Code for DA-682A Customization
B-3
// Close device
mxgpio_close(hLedDev);
break;
// if char == '2', Set the LED output
case 2:
// Get Port Number
_gettchar();
_tprintf(_T("Input the Port Number (0 ~ %d) = \r\n"), LED_PORT_NUMBER-1);
smode = _gettchar();
port_no = _tstoi(&smode);
// Get Value
_gettchar();
_tprintf(_T("Input the value (0 or 1) = "));
smode = _gettchar();
data = _tstoi(&smode);
// Open device
hLedDev = mxgpio_open();
// Set LED
nRet = mxgpio_set_data( hLedDev, port_no, data);
if ( nRet == -1 )
{
_tprintf(_T("Set led signal fail!\r\n"));
}
else
{
_tprintf(_T("Set led signal success!\r\n"));
}
// Close device
mxgpio_close(hLedDev);
break;
}
_gettchar();
sin = _gettchar();
n = _tstoi(&sin);
} while (n != 0);
return 0;
}

Содержание

Похожие устройства