All Iam looking forward for is a simple example, I
have the code in VC++. Iam pasting it below.
I want it to run on CGI through perl and have
interfacing from a browser.
This is just to test whether we r able to.
We r in process to test whether a new project on RT
control of Hardware is feasible.
Anyone help.
Mukund have alook at this and tell me how do u go
about it.
Iam also putting the pin configuration on.
I plan to paste it on programmers list as well but
that list is not so active.
We use a PCL card.
regards
vicki
#include <stdio.h>
#include <conio.h>
#include <dos.h>
int dummy, do_value, lsbyte, msbyte;
int base_port, i, j, k, m, n, steps, p;
int pattern[4];
char c, t;
char sense;
int send(int);
void wait(void);
main() /* DA using PCL718 card */
{
base_port = 0x0300;
printf("\n input number of steps ");
scanf("%d",&steps);
printf("\n input outer loop delay index
");
scanf("%d",&m);
printf("\n input inner loop delay ");
scanf("%d",&n);
fflush(stdin);
printf("\n input sense of rotation
CCW(l)/CW(r) ");
sense = getchar();
pattern[0] = 0x000A;
pattern[1] = 0x0006;
pattern[2] = 0x0005;
pattern[3] = 0x0009;
printf("\n stepper motor working\n\n\n");
p = 0;
if (sense == 'l'||sense=='L'){
for (i = 0; i < steps; i++){
send(pattern[p++]);
wait();
if (p == 4){
p = 0;
}
}
}
else if (sense == 'r' || sense == 'R'){
for (i=0; i < steps; i++){
send (pattern
[p--]);
wait();
if (p == -1){
p = 3;
}
}
} /* else if*/
}/*main*/
int send (int do_value)
{
lsbyte = (do_value & 0x00ff);
msbyte = ((do_value & 0xff00)
>> 8);
_outp((base_port+3), lsbyte);
_outp((base_port+11), msbyte);
}
void wait (void)
{
for (j=0; j < m; j++)
{
for (k=0; k < n;
k++)
{
}
}
}
Pin Configuration (26 pin connector):
01 - PC4 14 - PB1
02 � PC5 15 � PA6
03 � PC2 16 � PA7
04 � PC3 17 � PA4
05 � PC0 18 � PA5
06 � PC1 19 � PA2
07 � PB6 20 � PA3
08 � PB7 21 � PA0
09 � PB4 22 � PA1
10 � PB5 23 � PC6
11 � PB2 24 � PC7
12 � PB3 25 � GND
13 � PB0 26 � GND
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help