| rafale30 | Bonjour à tous j'ai modifié un programme en y rajoutant une boucle (do, while) pour éclairer silmultanément 2 états sur le port parallèle, le probleme est que ma boucle est trop lente et on voi le clignotemen a l'oeuil nu des leds, pourriez-vous m'aidez pour accélérer ma boucle merci a tous  
 
 | Code : 
 #include <stdio.h>#include <conio.h>#include <windows.h>/* OBLIGATOIRE - NE PAS TOUCHER *//* Définitions des fonctions intégrées à la DLL inpout32.dll */typedef short _stdcall (*inpFunction)(short portaddr);typedef void _stdcall (*oupFunction)(short portaddr, short data);/* FIN DE LA ZONE OBLIGATOIRE */int main(void){     /* OBLIGATOIRE - NE PAS TOUCHER */     HINSTANCE hLib;     inpFunction inp32;     oupFunction oup32;     /* FIN DE LA ZONE OBLIGATOIRE */     /* Les variables du programme */     short datasIn, datasOut;     int port;     /* OBLIGATOIRE - NE PAS TOUCHER */     /* Charge la libriairie */     hLib = LoadLibrary("inpout32.dll" );     if (hLib == NULL)     {          printf("ECHEC: LoadLibrary Failed !!!\n" );          return -1;     }     /* récupère les adresses des fonctions Inp32 et Out32 */     inp32 = (inpFunction)GetProcAddress(hLib, "Inp32" );     if (inp32 == NULL)     {          printf("ECHEC: GetProcAddress for Inp32 Failed !!!\n" );          return -1;     }     oup32 = (oupFunction)GetProcAddress(hLib, "Out32" );     if (oup32 == NULL)     {          printf("GetProcAddress for Oup32 Failed.\n" );          return -1;     }     /* FIN DE LA ZONE OBLIGATOIRE */     /* Début du programme de test */     /* Lecture des registres du port parallèle LPT1 (0x378 à 0x37F) */     for(port=0x378; (port<0x380); port++)     {          datasIn = inp32(port);          printf("Port LPT read 0x%03X = %04X\n", port, datasIn);     }     printf("\n" );     do     {     /* Ecriture sur le port parallèle */     port = 0x378;    /* registre DATA */     datasOut = 0x03; /* 0000 0001 */     oup32(port, datasOut);     ;printf("Port LPT write to 0x%X : datasOut=0x%2X\n", port, datasOut);     /* Lecture de vérification */     datasIn = inp32(port);     ;printf("Port LPT read 0x%03X = %04X\n", port, datasIn);     /* SHOOT AGAIN: Ecriture sur le port parallèle */     port = 0x378;    /* registre DATA */     datasOut = 0xC0; /* 10000000 */     oup32(port, datasOut);     ;printf("Port LPT write to 0x%X : datasOut=0x%2X\n", port, datasOut);     /* Lecture de vérification */     datasIn = inp32(port);     ;printf("Port LPT read 0x%03X = %04X\n", port, datasIn);     /* Fin du programme de test */      } while (1)   ;     /* OBLIGATOIRE - NE PAS TOUCHER */     /* libère la librairie */     FreeLibrary(hLib);     /* FIN DE LA ZONE OBLIGATOIRE */     return 0;}
 | 
   |