2.21ADChay
// 2_21.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
#include
int _tmain(int argc, _TCHAR* argv[])
{
int base,Data1,Data2;
base=Get_Addr("PCI_ADC");
do
{
outportb(base,0x01);
outportb(base+1,0x10);
Sleep(50);
Data1=inportb(base);
Data2=inportb(base+1);
outportb(base+1,0x00);
printf("\r%d",Data1+Data2*16);
}while(kbhit()!=1);
getch();
return 0;
}
Bạn đang đọc truyện trên: Truyen247.Pro