Hola buenas, tengo un problema estoy ocupando un programa llamado LCC-win32, pero he tenido muchos problemas para compilar y crear nuevos proyectos, algun programa mas facil de utilizar, ademas necesito en el programa insertar un cronometro y un aformula que calcule la aceleracion de un objeto que pasa por dos sensores, tengo la velocidad inicial, la ditancia, esto lo pienso hacer con un while, dejo pregrama,,...gracias
/**************************************************/
/*** ***/
/*** TEST.c -- test interface to inpout32.dll ***/
/*** ( http://www.logix4u.net/inpout32.htm ) ***/
/*** ***/
/*** Copyright (C) 2003, Douglas Beattie Jr. ***/
/*** ***/
/*** <beattidp@ieee.org> ***/
/*** http://www.hytherion.com/beattidp/ ***/
/*** ***/
/**************************************************/
/*******************************************************/
/* */
/* Builds with Borland's Command-line C Compiler */
/* (free for public download from Borland.com, at */
/* http://www.borland.com/bcppbuilder/freecompiler ) */
/* */
/* Compile with: */
/* */
/* BCC32 -IC:\BORLAND\BCC55\INCLUDE TEST.C */
/* */
/* */
/* Be sure to change the Port addresses */
/* accordingly if your LPT port is addressed */
/* elsewhere. */
/* */
/*******************************************************/
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <time.h>
/* Definitions in the build of inpout32.dll are: */
/* short _stdcall Inp32(short PortAddress); */
/* void _stdcall Out32(short PortAddress, short data); */
/* prototype (function typedef) for DLL function Inp32: */
typedef short _stdcall (*inpfuncPtr)(short portaddr);
typedef void _stdcall (*oupfuncPtr)(short portaddr, short datum);
int main(void)
{
HINSTANCE hLib;
inpfuncPtr inp32;
oupfuncPtr oup32;
short x;
int i;
time_t start,end;
double dif;
/* Load the library */
hLib = LoadLibrary("inpout32.dll");
if (hLib == NULL) {
printf("LoadLibrary Failed.\n");
return -1;
}
/* get the address of the function */
inp32 = (inpfuncPtr) GetProcAddress(hLib, "Inp32");
if (inp32 == NULL) {
printf("GetProcAddress for Inp32 Failed.\n");
return -1;
}
oup32 = (oupfuncPtr) GetProcAddress(hLib, "Out32");
if (oup32 == NULL) {
printf("GetProcAddress for Oup32 Failed.\n");
return -1;
}
/***************************************************************/
/* now test the functions */
/* Try to read 0x378..0x37F, LPT1: */
do{
i=0x379;
x=0;
x = (inp32)(i);
printf("- (%04X)= %04X",i,x);
printf("\n");
}while(x!=0x68);
time (&start);
/* Try to read 0x378..0x37F, LPT1: */
do{
i=0x379;
x=0;
x = (inp32)(i);
printf("- (%04X)= %04X",i,x);
printf("\n");
}while(x!=0xF8);
//sleep(150);
/*
x=0;
x = (inp32)(i);
printf("port read (%04X)= %04X\n",i,x);
*/
/*
x=0;
x = (inp32)(i);
printf("port read (%04X)= %04X\n",i,x);
*/
time (&end);
dif = difftime (end,start);
printf(" El tiempo transcurrido es de %.2lf seg.\n", dif);
FreeLibrary(hLib);
return 0;
}