2.17doi0,255..->analog

/*

Chuong trinh demo DAC

*/

#include "stdafx.h"

#include<conio.h>

#include<stdio.h>

#include<dos.h>

#include<PCIXP.h>

void main()

{

int gt[6]={0, 255, 511, 1023, 2047, 4095};

int add=Get_Addr("PCI_ADC");

for(i=0; i<6; i++)

{

outportb(add+2, gt[i]);

outportb(add+3, gt[i]>>8);

printf("

Gia tri vua nap vao DAC la: %5d.",gt[i]);

printf("

\tBam 1 phim bat ki de nap gia tri tiep theo.");

getch();

}

}

Bạn đang đọc truyện trên: TruyenTop.Vip

Tags: #may#tinh