Hallo,
ich bin gerade dabei eine Software für folgende Schaltung zu schreiben:
hier meine ersten Ansätze:
Code:
#include <stdio.h>
#include <string.h>
#include <asm/io.h>
#define D_COM1 0x3F8
/* define D_COM2 0x2F8 */
int main( int argc, char *argv[] )
{
if ( ioperm( D_COM1, 6, 1) != 0 ) { /* get IO/perm */
perror( "ERROR: can´t open COM device for read/write" );
return(-1);
}
outb( 0x00, D_COM1 ); /*alles low*/
outb( 0x0C, D_COM1 ); /* data 1 , clock 1*/
outb( 0x00, D_COM1 ); /* clock 0*/
outb( 0x08, D_COM1 ); /data 0 , clock 1*/
outb( 0x00, D_COM1 ); /*clock0 */
outb( 0x0C, D_COM1 ); /*data 1 clock 1*/
outb( 0x00, D_COM1 ); /* clock 0*/
outb( 0x40, D_COM1 ); /*strobe 1*/
outb( 0x00, D_COM1 ); /*strobe 0 */
return( 0 );
}
ich denke der Code erklärt sich von selbst.
Nun das Problem: Wenn ich das Programm mit gcc -o test test.c -O2 kompiliere und ausführe tut sich leider an LEDs überhaupt nichts. Ich hoffe ihr könnt mir sagen , warum sich nichts tut.
Gruß
Michi
Lesezeichen