Ver Mensaje Individual
  #7 (permalink)  
Antiguo 18/04/2009, 19:13
Dark Kronox
 
Fecha de Ingreso: abril-2007
Mensajes: 73
Antigüedad: 17 años
Puntos: 0
Respuesta: semaforo en C

mira realmente no tengo idea ke libreria va a funcionar... asi ke coloke la ke me ivan diciendo xD

Cita:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/io.h>
#include <conio.h>
#include <dos.h>

int c;
int x;
int main ()
{

printf(" Semaforo Por Puerto Paralelo\n");
printf("Ingrese La Cantidad De Ciclos: \n");
scanf("%d",x);
for (c=1; c<=x; c++)
{
_outp(0x378,0); // Envía CEROS (LEDS OFF)
Sleep(1000);
_outp(0x378,2); // Envía UNOS (LEDS ON)
Sleep(1000);
_outp(0x378,0);
Sleep(1000);
_outp(0x378,4);
Sleep(1000);
_outp(0x378,0);
Sleep(1000);
_outp(0x378,8);
Sleep(1000);

}
}
no toy seguro si esta bien... me tira este error :

C:\Users\Desktop\Semaforo.cpp In function `int main()':
19 C:\Users\Desktop\Semaforo.cpp `_outp' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)


eso estara biene escrito?...

explico lo ke kieor hacer es prender un led y apagarlo y luego prender el otro y hasi sucesivamente.. verde amarillo rojo / verde amarillo rojo / verde amarillo rojo / ....


esop saludos =D