parallel programming in linux

I

iveqy.mailbox

I don't get any output on pin 2. What's the problem?

#include <stdio.h>
#include <unistd.h>
#include <sys/io.h>
#include <stdlib.h>
#include <iostream>

#define BASEPORT 0x378

using namespace std;


int main()
{
if (ioperm(BASEPORT, 3, 1))
{
perror("ioperm");
cout << "Error!" << endl;
exit(1);
}

cout << "Light off\n";
outb(0, BASEPORT);
sleep(2);

cout << "Light on\n";
outb(1, BASEPORT);
sleep(2);

if (ioperm(BASEPORT, 3, 0))
{
perror("ioperm");
cout << "Error" << endl;
exit(1);
}
exit(0);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top