473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

outportb problem

Greetings to all,

i am not sure this is the write group to post my question to. If it is
not i apologize. In the mean time if you have the answer to my
question please help. THANKS!!

i am trying to write a program using parallel port. I wrote this
program to change the port number to one or zero. I am not able to
change the port number from one to zero. It takes it sever run time to
change from one to zero. WHY? ANY SUGGESTIONS?

#include <conio.h>
#include <stdio.h>
#include <dos.h>

int main()
{
char ch, ch2;

while (getch() != 'E')
{
printf ("please enter z to write zero to the parallel port \n");
printf ("please enter o to write one to the parallel port \n");

ch = getch();
if (ch = = 'z')
{
outportb (0x3BC, 0x00);
printf ("writing 0 to the parallel port \n");
}

if (ch == 'o')

outportb (0x3BC, 0x0F);
printf ("writing one to the parallel port \n");
}
};

Feb 10 '06 #1
2 2939
rick wrote:
i am not sure this is the write group to post my question to. If it is
not i apologize. In the mean time if you have the answer to my
question please help. THANKS!!

i am trying to write a program using parallel port. I wrote this
program to change the port number to one or zero. I am not able to
change the port number from one to zero. It takes it sever run time to
change from one to zero. WHY? ANY SUGGESTIONS?

#include <conio.h>
#include <stdio.h>
#include <dos.h>

[...]


The newsgroup to post your question is 'comp.os.msdos.programmer'.

V
--
Please remove capital As from my address when replying by mail
Feb 10 '06 #2

"rick" <ri******@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Greetings to all,

i am not sure this is the write group to post my question to. If it is
not i apologize. In the mean time if you have the answer to my
question please help. THANKS!!

i am trying to write a program using parallel port. I wrote this
program to change the port number to one or zero. I am not able to
change the port number from one to zero. It takes it sever run time to
change from one to zero. WHY? ANY SUGGESTIONS?

#include <conio.h>
#include <stdio.h>
#include <dos.h>

int main()
{
char ch, ch2;

while (getch() != 'E')
{
printf ("please enter z to write zero to the parallel port \n");
printf ("please enter o to write one to the parallel port \n");

ch = getch();
if (ch = = 'z')
{
outportb (0x3BC, 0x00);
printf ("writing 0 to the parallel port \n");
}

if (ch == 'o')

outportb (0x3BC, 0x0F);
printf ("writing one to the parallel port \n");
}
};


If this is your real code, you are missing breackets after if ( ch=='o' ) to
include the next two lines. Meaning that it would print "writing one to the
parallel port \n" every time. Although it would only set the port if 'o'
was pressed.

Other than that try in a newsgroup appropriate to your OS. I'm guessing
it's windows so try microsoft.public.vc.language.
Feb 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
117
by: Peter Olcott | last post by:
www.halting-problem.com
4
by: Pegboy | last post by:
I am updating a utility to capture serial port data that was originally developed as a DOS app using the outportb() and inportb() routines. I am trying to re-work it as a Win32 app using Borland...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
2
by: shashi59 | last post by:
Anyone plz explain outportb function.And also explain the code below........ #define PORT1 0x3F8 outportb(PORT1 + 1 , 0); outportb(PORT1 + 3 , 0x80); outportb(PORT1 + 1 ,...
3
by: maheshchintu | last post by:
Can i use outportb() in windowsXP...... then how should i interface PC's parallel port with outside circuits for my project,.... is there any exact replacement for outportb().
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.