Jump to content

asm/io.h ou sys/io.h?


Recommended Posts

Posted

Boas 😄 no seguimento do tópico da porta paralela eu andei á procura de maneira de fazer um programa em C para controlar os Leds... pois bem... estou em windows a programar no Dev-C++ e não consigo arranjar header que tenha a funçao outb() ou outportb(); porque não tenho o raio das headers... alguém me consegue ajudar com isto ?

Thanks 😛

Posted

Já deste uma vista d'olhos neste código?

#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define LPT1 0x378
int main(void)
{
    unsigned char Valor=128; //Em binário: 10000000
    while( Valor > 0 )
   {    
              outportb(LPT1, Valor); // Envia para a Porta LPT1
              printf("\nPressione uma tecla para ascender o próximo LED...");
              getch( ); 
              Valor = Valor >> 1; //A cada passagem, o bit 1 é movido para a direita 
    }
} 

é verdade, já agora,..em VB6 já metes-te isso a trabalhar,não?

cool stuffs to check.

http://blog.zxcoders.com//

Posted

Ya em VB tá a funcionar 😄

Edit: com o teu programa tá na mesma :| dá o mesmo erro a compilar :|

gcc.exe "C:\Documents and Settings\Pedro\My Documents\C Projects\paralela.c" -o "C:\Documents and Settings\Pedro\My Documents\C Projects\paralela.exe"   -g3  -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib" -g3 
C:\DOCUME~1\Pedro\LOCALS~1\Temp/ccOUbaaa.o(.text+0x44): In function `main':
C:/Documents and Settings/Pedro/My Documents/C Projects/paralela.c:10: undefined reference to `outportb'
collect2: ld returned 1 exit status

Execução terminada

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.