First commit 10/04/1996
This commit is contained in:
63
PLACA.CPP
Normal file
63
PLACA.CPP
Normal file
@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include "prn_cnt.h"
|
||||
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
char ok = 0;
|
||||
int salida, estado;
|
||||
|
||||
Lpt_usado = 1;
|
||||
Init_all();
|
||||
/*
|
||||
do
|
||||
{
|
||||
for ( salida = 1; salida<=128; salida*=2 )
|
||||
{
|
||||
Escribe_Salidas( 6, NULL, (char)salida );
|
||||
delay(50);
|
||||
}
|
||||
for ( salida = 128; salida>1; salida/=2 )
|
||||
{
|
||||
Escribe_Salidas( 6, NULL, (char)salida );
|
||||
delay(50);
|
||||
}
|
||||
}while( !kbhit() );
|
||||
*/
|
||||
/*
|
||||
do
|
||||
{
|
||||
printf( "\n Introduzca salida y estado: " );
|
||||
scanf( "%d %d", &salida, &estado );
|
||||
Escribe_Salida( (char)salida, (char)estado );
|
||||
// Escribe_Salidas( 6, NULL, (char)salida );
|
||||
|
||||
} while( salida>0 );
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
estado = Lee_Entradas( 6, NULL );
|
||||
printf( "\n%d %d %d %d %d %d %d %d", ( estado & 0x80 ) != 0,
|
||||
( estado & 0x40 ) != 0,
|
||||
( estado & 0x20 ) != 0,
|
||||
( estado & 0x10 ) != 0,
|
||||
|
||||
( estado & 0x08 ) != 0,
|
||||
( estado & 0x04 ) != 0,
|
||||
( estado & 0x02 ) != 0,
|
||||
( estado & 0x01 ) != 0 );
|
||||
getch();
|
||||
|
||||
} while( !kbhit() );
|
||||
|
||||
|
||||
|
||||
// ESCRIBIR ES UN '1'
|
||||
// La direcci<63>n de la placa es '6'
|
||||
// ===> la direcci<63>n '0' es: 1 000 0011
|
||||
}
|
Reference in New Issue
Block a user