lol, not only are they lazy but they are misinformed. 90% of wii games involve little to no motion. Of all the games i have, only wiisports requires any form of excercise. Most of the games merely need a flick of the wrist or pointing at the screen. Both of those things can be done with the remote resting in your lap. ughMy cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
Not at all...Nintendo has been coming out with messed up games ever since the nintendo gamecube. The graphics aren't that good and I don't think the system is worth playing. Some people just don't like motion controls because it takes away from the feel of the game. I prefer to have the controller in my hand than using motion. Not that I'm lazy...I just prefer using a regular controller.My cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
No, not at all. Video games and exercise are separate things. Besides, to me, the whole point of video games is to sit down and forget about your troubles. It is just more relaxing to sit rather than to exercise. Also, most of the games I want are on the PS3 or Xbox 360. I'm more of a horror, violent, bloody, guns, and swords type of gamer. To me most of the games on the wii are about movement...not about killing things.
i wouldnt say lazy, i think people just prefer to hold a standard controller in their hands.
i absolutely love my wii, and at this moment in time its getting a lot more play time than my ps3 or 360 (360 is dead though so thats a given). the wii is a great console and full of some amazing exclusives.
Yes, of course. Your cousin is smart.
agree for sure!
yes i agree
Friday, August 6, 2010
I have a question about Mortal Kombat vs DC and how the controls are?
Okay so I was seeing a lot of youtube videos of MK vs DC and I hear a lot of hardcore MK fans not really liking it but I also hear a lot of fighting fans praising it, but I for one think it looks like a solid fighting game, only thing is that I don't know how it plays!
can someone tell me how the control scheme is and if it's easy free flowing or weird and stubborn?
and can you also compare the controls to other games i've played?
for example I have Tekken 5, Dead or Alive 4, Marvel vs Capcom 2, Soul Calibur, Street Fighter EX Plus, and HAVE PLAYED Mortal Kombat Armageddon
can anyone tell me which game MK vs DC feels the most similar to or if it is a completely different game?
also, i've played MK Armageddon and I was HORRIBLE at it, the controls were so not what i'm used to compared to the ones that I have
thanks ya'll!I have a question about Mortal Kombat vs DC and how the controls are?
It's an OK game , i wouldn't say it's the best Mortal Kombat game iv'e played , the original on the PS1 i think will be everyone's favourite.
If youv'e ever played that game the control's are very much the same , how ever if you haven't i'd say the controls are most like the same as Tekken , for example %26lt;%26lt;[] (left , left , square) will use Scorpions spear move etc , and most special moves are similair to that , as for the punching , kicking , Square , Cirlce , Triangle etc are the main one's
Fatality moves are a bit trickyer , sometimes they work , other's they don't as you have to be so close or so far from your opponent and sometime's it'l work , other's it won't work all night.
I think they could have made this game alot better if they had put a wider range of characters in , for Mortal Kombat for example they should have put Rain , Reptile , Ermac in , and as for DC they should have put Venom in , would have made it that little bit better.
Like i said , it's not my favourite game , or even favourite Mortal Kombat game , but it's far from the worst , good to play with mates and online , i'd give it a 7/10 , but worth the money.I have a question about Mortal Kombat vs DC and how the controls are?
first of all i wouldn't call mk vs.dc a fighting game ok! i mean the game has no storyline the finishing moves are watered down the two boss characters don't even have finishing moves and the characters themselves don't have other costumes they just have recolors of the ones they start with and secondly that one guy told you that they should have more dc characters in it like venom well i hate to burst your bubble but venom is a marvel character not a dc character venom is the evil version of spiderman so i wouldn't even get mk vs.dc because as a fighting game it's a joke and not a funny joke at that !
can someone tell me how the control scheme is and if it's easy free flowing or weird and stubborn?
and can you also compare the controls to other games i've played?
for example I have Tekken 5, Dead or Alive 4, Marvel vs Capcom 2, Soul Calibur, Street Fighter EX Plus, and HAVE PLAYED Mortal Kombat Armageddon
can anyone tell me which game MK vs DC feels the most similar to or if it is a completely different game?
also, i've played MK Armageddon and I was HORRIBLE at it, the controls were so not what i'm used to compared to the ones that I have
thanks ya'll!I have a question about Mortal Kombat vs DC and how the controls are?
It's an OK game , i wouldn't say it's the best Mortal Kombat game iv'e played , the original on the PS1 i think will be everyone's favourite.
If youv'e ever played that game the control's are very much the same , how ever if you haven't i'd say the controls are most like the same as Tekken , for example %26lt;%26lt;[] (left , left , square) will use Scorpions spear move etc , and most special moves are similair to that , as for the punching , kicking , Square , Cirlce , Triangle etc are the main one's
Fatality moves are a bit trickyer , sometimes they work , other's they don't as you have to be so close or so far from your opponent and sometime's it'l work , other's it won't work all night.
I think they could have made this game alot better if they had put a wider range of characters in , for Mortal Kombat for example they should have put Rain , Reptile , Ermac in , and as for DC they should have put Venom in , would have made it that little bit better.
Like i said , it's not my favourite game , or even favourite Mortal Kombat game , but it's far from the worst , good to play with mates and online , i'd give it a 7/10 , but worth the money.I have a question about Mortal Kombat vs DC and how the controls are?
first of all i wouldn't call mk vs.dc a fighting game ok! i mean the game has no storyline the finishing moves are watered down the two boss characters don't even have finishing moves and the characters themselves don't have other costumes they just have recolors of the ones they start with and secondly that one guy told you that they should have more dc characters in it like venom well i hate to burst your bubble but venom is a marvel character not a dc character venom is the evil version of spiderman so i wouldn't even get mk vs.dc because as a fighting game it's a joke and not a funny joke at that !
I am controlling the speed of dc shunt motor using labview and DAq card some one help me?
i need to design a pid controller using labview
and the output is controling a circuit that control the speed of the dc motor
i need to make the speed don't change
even if i changed the loadI am controlling the speed of dc shunt motor using labview and DAq card some one help me?
Do you measure the speed?
In that case a feed back loop should be easy to make with Labview:
measure the speed, and *slowly* change the current according to the difference with the requested value.
You can measure the speed by counting light pulses from a light seen through a hole mounted on the motor (or the object your driving with the motor).
and the output is controling a circuit that control the speed of the dc motor
i need to make the speed don't change
even if i changed the loadI am controlling the speed of dc shunt motor using labview and DAq card some one help me?
Do you measure the speed?
In that case a feed back loop should be easy to make with Labview:
measure the speed, and *slowly* change the current according to the difference with the requested value.
You can measure the speed by counting light pulses from a light seen through a hole mounted on the motor (or the object your driving with the motor).
My cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
No. I think people don't like to play the wii because they are older or more intelligent than a 5 year old, the games all suck and the graphics are the worst.My cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
I agree this is a stupid question. Who really cares.My cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
No, but does it matter?
yes i agree
my gf and i agree
I agree this is a stupid question. Who really cares.My cousin in DC said people who don't like to play the wii because of motion controls are lazy. do you agree?
No, but does it matter?
yes i agree
my gf and i agree
DC Motor Speed Controlling?
i have a DC motor that i need to control it's speed, the motor is for an R/C car am using for my project
the motor operates at 6V so i supplied it with a 6V battery, and it turned and everything went great
i thought that i can decrease the speed by adding a resistance before the 6V input to the DC motor
so i added into the circuit a 500k ohm resistance (since the 10K didnt have almost any effect on the output voltage), this 500k gave a 3V output so i thought that the motor will run half speed as it used to be
but when i connected the DC motor to the circuit it didnt work!!
so i connected the DC before the 500k (at the 6V) and it ran fine, but when i reconnected it back after the 500k it just stopped!!
does any1 have any idea what might be the problem?!
or do u have any idea about how to control this DC motor speed?
i want to connect it to a PIC16F877A and use it to control the flow of the voltages supplied to the DC to control its speed...that was my idea, but if the DC wont be able to run at lower voltage than 6V then i guess am having a big problem
can any1 help me? plzzzzzzzzzzzzzzzzzzzzzzzzzzzzDC Motor Speed Controlling?
The problem is your resistance is way too big. (Let me guess, you are using a mechanical voltmeter and you measured 3V with just the battery and resistor connected to the voltmeter.) Ohm's Law says 6V into 500K惟 gives only 12碌A of current, so it's not surprising your motor didn't run like that! A few tens of ohms of resistance should be plenty to reduce the speed. You need to measure the voltage at the motor while it's actually in circuit with the resistor.
If you're using a microcontroller, though, consider pulse width modulation. This works by supplying the motor with 6V for awhile, then turning off the supply; and repeating the whole thing over and over again, with a cycle time of a few tens or hundreds of microseconds. The proportion of time spent ';on'; determines the speed; but since the full 6V is applied to the motor, the full starting torque is available.
This is easily achieved with a loop and a two 1-byte registers. One register is used as a counter and gets incremented each time you go around the loop. Turn the motor output OFF when the counter reaches a threshhold value stored in another register (which you can change to set the speed) and ON when it overflows from 255 to 0 (you can test for this happening because it will set the ';carry'; flag in the status register). The bigger the number in the threshhold register, the longer it will take for the counter to reach that value and so the longer the output will remain ';on';.
Note that many modern microcontrollers have the ability to do pulse width modulation in hardware; when enabled, you just write a number to a register and you get an automatic PWM output on one of the I/O lines, the bigger the number the longer the ';on'; time.DC Motor Speed Controlling?
The resistor is way too high. You can control the speed by adding a resistor in series, but it needs to be related to the current and the voltage by ohms law. R = V/I.
If you use a multimeter to measure the current, use a 2A range or higher, otherwise the multimeter will add so much resistance that it confuses the measurement.
If there is 150mA flowing for example, the motor would be the equivalent of a 40 ohm resistor. However this is a fairly useless way of controlling permanent magnet motors, as the energy lost in the resistor is wasted, and the load on the motor varies so the voltage varies etc. The potentiometer has to have a sufficient current and power rating to suit the job. A suitable one is hard to find, and It is better to use other ways. Cheaper too. Just takes more knowledge and effort perhaps.
You can vary the speed with less loss using Pulse Width Modulation (PWM), especially suited to a microcontroller. Some have a PWM device built in, others you can do it with software. Simply, the motor is switched on and off rapidly. If it is on for half the time, then half the speed, and so on. A few hundred Hertz is usually fast enough. A diode needs to be connected across the motor in reverse to protect the transistor used to switch the motor on and off. For a uContoller I/O connection, better to use a small power FET, or a CMOS gate as a driver for a transistor. Look up PIC and PWM, I am sure you will find the method that suits yuour particular desires. You could use a small 8 pin PIC if that is all it has to do. If you wish to control teh speed externally, you would probably use push buttons (up/ down/ stop).
There is another way, use remote control radio equipment. There are motor speed controlls that connect to the receiver. This method uses off the shelf plug in modules, but you have to buy a transmitter and receiver and speed control that all go together. Maybe an el cheapo toy Radio Controlled model car is the way to get this setup, including a motor etc.
You can also use a 555 timer for PWM with a knob to control it. This would be a very good project for experience, and the link below shows how to do it, from the basics almost. It is what you wanted to do, but works better.
the motor operates at 6V so i supplied it with a 6V battery, and it turned and everything went great
i thought that i can decrease the speed by adding a resistance before the 6V input to the DC motor
so i added into the circuit a 500k ohm resistance (since the 10K didnt have almost any effect on the output voltage), this 500k gave a 3V output so i thought that the motor will run half speed as it used to be
but when i connected the DC motor to the circuit it didnt work!!
so i connected the DC before the 500k (at the 6V) and it ran fine, but when i reconnected it back after the 500k it just stopped!!
does any1 have any idea what might be the problem?!
or do u have any idea about how to control this DC motor speed?
i want to connect it to a PIC16F877A and use it to control the flow of the voltages supplied to the DC to control its speed...that was my idea, but if the DC wont be able to run at lower voltage than 6V then i guess am having a big problem
can any1 help me? plzzzzzzzzzzzzzzzzzzzzzzzzzzzzDC Motor Speed Controlling?
The problem is your resistance is way too big. (Let me guess, you are using a mechanical voltmeter and you measured 3V with just the battery and resistor connected to the voltmeter.) Ohm's Law says 6V into 500K惟 gives only 12碌A of current, so it's not surprising your motor didn't run like that! A few tens of ohms of resistance should be plenty to reduce the speed. You need to measure the voltage at the motor while it's actually in circuit with the resistor.
If you're using a microcontroller, though, consider pulse width modulation. This works by supplying the motor with 6V for awhile, then turning off the supply; and repeating the whole thing over and over again, with a cycle time of a few tens or hundreds of microseconds. The proportion of time spent ';on'; determines the speed; but since the full 6V is applied to the motor, the full starting torque is available.
This is easily achieved with a loop and a two 1-byte registers. One register is used as a counter and gets incremented each time you go around the loop. Turn the motor output OFF when the counter reaches a threshhold value stored in another register (which you can change to set the speed) and ON when it overflows from 255 to 0 (you can test for this happening because it will set the ';carry'; flag in the status register). The bigger the number in the threshhold register, the longer it will take for the counter to reach that value and so the longer the output will remain ';on';.
Note that many modern microcontrollers have the ability to do pulse width modulation in hardware; when enabled, you just write a number to a register and you get an automatic PWM output on one of the I/O lines, the bigger the number the longer the ';on'; time.DC Motor Speed Controlling?
The resistor is way too high. You can control the speed by adding a resistor in series, but it needs to be related to the current and the voltage by ohms law. R = V/I.
If you use a multimeter to measure the current, use a 2A range or higher, otherwise the multimeter will add so much resistance that it confuses the measurement.
If there is 150mA flowing for example, the motor would be the equivalent of a 40 ohm resistor. However this is a fairly useless way of controlling permanent magnet motors, as the energy lost in the resistor is wasted, and the load on the motor varies so the voltage varies etc. The potentiometer has to have a sufficient current and power rating to suit the job. A suitable one is hard to find, and It is better to use other ways. Cheaper too. Just takes more knowledge and effort perhaps.
You can vary the speed with less loss using Pulse Width Modulation (PWM), especially suited to a microcontroller. Some have a PWM device built in, others you can do it with software. Simply, the motor is switched on and off rapidly. If it is on for half the time, then half the speed, and so on. A few hundred Hertz is usually fast enough. A diode needs to be connected across the motor in reverse to protect the transistor used to switch the motor on and off. For a uContoller I/O connection, better to use a small power FET, or a CMOS gate as a driver for a transistor. Look up PIC and PWM, I am sure you will find the method that suits yuour particular desires. You could use a small 8 pin PIC if that is all it has to do. If you wish to control teh speed externally, you would probably use push buttons (up/ down/ stop).
There is another way, use remote control radio equipment. There are motor speed controlls that connect to the receiver. This method uses off the shelf plug in modules, but you have to buy a transmitter and receiver and speed control that all go together. Maybe an el cheapo toy Radio Controlled model car is the way to get this setup, including a motor etc.
You can also use a 555 timer for PWM with a knob to control it. This would be a very good project for experience, and the link below shows how to do it, from the basics almost. It is what you wanted to do, but works better.
Computer controlling a DC motor...?
Hi,
I've heard this is possible and now I'd like to do it. I've been told that I can build, on a breadboard, a controller device that would let my computer control a motor connected to a battery (and tell it to run forwards, backwards, and at a variable speed). Does anyone know how to do this specifically (we can talk about it through E-mails or IM) or a site that has instructions for how to do this? If my computer could ';talk'; to the board through my USB or Modem, that would be great. As for programming, I'd like to use JAVA or C, if that makes any difference.
ThanksComputer controlling a DC motor...?
Stepper Motor (including circuitry)
Intel 8255 PC interface card
/*
FILE: STEPPER.C Adapted from Stepper.c by P.Oh
DESC: Speed and Positioning options for Stepper Motor
Port A has 5 lines attached and described as follows:
OP = PHASE Line A.0 1 enable / 0 disable
HS = HALF STEP Line A.1 2 enable / 0 disable
SI = STEP INPUT Line A.2 4 enable / 0 disable
DR = DIRECTION Line A.3 8 enable / 0 disable
OE : OUTPUT ENABLE Line A.4 16 enable / 0 disable
*/
#include%26lt;stdio.h%26gt;
#include%26lt;stdlib.h%26gt;
#include%26lt;dos.h%26gt; /* outportb, inportb defined here */
#include%26lt;conio.h%26gt; /* formatted text functions defined here */
void StepTheMotor(int, int, int);
void Selection(int, int, int);
void MoveToFixedAngle(int, int, int);
void Continuous(int, int, int);
void main(void) {
int Sgnal;
int BASEADDR;
int PORTA, PORTB, PORTC;
int CNTRL;
int Choice;
int StepsPerRev;
int DR = 0;
clrscr(); /* clear screen */
window(5,5,75,30); /* set up text window */
gotoxy(1,1);
cprintf(';Enter Base Address (decimal) e.g. 608\n';);
gotoxy(1,2); scanf(';%d';, %26amp;BASEADDR);
PORTA = BASEADDR;
PORTB = BASEADDR + 1;
PORTC = BASEADDR + 2;
CNTRL = BASEADDR + 3;
outportb(CNTRL, 128); /* configure all ports for output */
outportb(PORTB, 0); /* Ports B and C not used, so just set to 0 */
outportb(PORTC, 0);
StepsPerRev = 96;
Selection(PORTA, StepsPerRev, DR);
} /* end of main */
void Selection(int PORTA, int StepsPerRev, int DR) {
/* Motor speed and position options */
int DegPerStep;
int Choice;
clrscr();
gotoxy(1,4); cprintf(';Motor requires %d steps per rev\n';, StepsPerRev);
DegPerStep = (int)(360 / StepsPerRev);
gotoxy(40,4); cprintf('; =%26gt; thus 1 step = %d degrees\n';, DegPerStep);
do {
gotoxy(1,6); cprintf(';(1) To rotate to a certain angle clockwise\n';);
gotoxy(1,7); cprintf(';(2) To rotate to a certain angle counter-clockwise\n';);
gotoxy(1,8); cprintf(';(3) To rotate continuously - with speed options\n';);
gotoxy(1,9); cprintf(';(4) To quit\n';);
gotoxy(1,10); cprintf(';Selection =%26gt;\n';);
gotoxy(14,10); scanf(';%d';, %26amp;Choice);
switch(Choice) {
case 1 : DR = 0;
MoveToFixedAngle(PORTA, DR, DegPerStep);
break;
case 2 : DR = 8;
MoveToFixedAngle(PORTA, DR, DegPerStep);
break;
case 3 : Continuous(PORTA, DR, StepsPerRev);
break;
case 4 : outportb(PORTA, 16); /* shutdown all signals */
gotoxy(1,22); cprintf(';Quitting\n';);
exit(0);
default : gotoxy(1,14); cprintf(';Choose 1, 2, 3, or 4\n';);
break;
}; /* end select */
} while (1); /* can only exit Selection if user selects 4 */
}; /* end of Selection */
void MoveToFixedAngle(int PORTA, int DR, int DegPerStep) {
int Degrees;
int NumberOfSteps;
char *GetKey[2];
int WaitSomeTime = 0;
int i;
clrscr();
if(DR == 0) {
gotoxy(1,4); cprintf(';Will step CW fixed number of degrees\n';);
} else { /* DR is 8 */
gotoxy(1,4); cprintf(';Will step CCW fixed number of degrees\n';);
};
gotoxy(1,5); cprintf(';Enter number of degrees =%26gt; ';);
gotoxy(28,5); scanf(';%d';, %26amp;Degrees);
gotoxy(1,7); cprintf(';Will step %d degrees';, Degrees);
gotoxy(1,8); cprintf(';Hit a key to start';);
while (!kbhit());
NumberOfSteps = (int)(Degrees / DegPerStep);
for(i = 1; i %26lt;= NumberOfSteps; i++) {
StepTheMotor(PORTA, DR, WaitSomeTime);
};
gotoxy(1,10); cprintf(';Finished!';);
gotoxy(1,11); cprintf(';Hit a key then %26lt;ENTER%26gt; to do another angle';);
gotoxy(42,11); cprintf(';or q then %26lt;ENTER%26gt; to quit to main menu';);
scanf(';%s';, %26amp;GetKey);
if(GetKey[0] == 'q' || GetKey[0] == 'Q') {
clrscr();
return;
} else {
MoveToFixedAngle(PORTA, DR, DegPerStep);
};
}; /* end of MoveToFixedAngle */
void Continuous(int PORTA, int DR, int StepsPerRev) {
int WaitSomeTime;
int TapKey;
int SpeedGrade;
int OE;
clrscr();
gotoxy(1,2); cprintf(';Tap a key:';);
gotoxy(1,3); cprintf(';(f)aster';);
gotoxy(1,4); cprintf(';(s)lower';);
gotoxy(1,5); cprintf(';(r)everse';);
gotoxy(1,6); cprintf(';(q)quit to main menu';);
gotoxy(1,7);
WaitSomeTime = 0;
SpeedGrade = 1;
do {
do {
StepTheMotor(PORTA, DR, WaitSomeTime);
} while(!kbhit());
TapKey = getch();
switch(TapKey) {
case 102 : /* hit f key */
WaitSomeTime = WaitSomeTime + 5;
if(WaitSomeTime %26gt;= 100) {
WaitSomeTime = 100;
gotoxy(1,10); cprintf(';Can't go faster';);
SpeedGrade = 20;
} else {
gotoxy(1,10); cprintf(';Going faster...';);
SpeedGrade = SpeedGrade + 1;
};
gotoxy(1,12); cprintf(';speed grade = %2d';, SpeedGrade);
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 115 : /* hit s key */
WaitSomeTime = WaitSomeTime - 5;
if(WaitSomeTime %26lt;= 0) {
WaitSomeTime = 0;
gotoxy(1,10); cprintf(';Won't go slower';);
SpeedGrade = 0;
} else {
gotoxy(1,10); cprintf(';Going slower...';);
SpeedGrade = SpeedGrade - 1;
};
gotoxy(1,12); cprintf(';speed grade = %2d';, SpeedGrade);
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 114 : /* hit the r key */
gotoxy(1,14); cprintf(';Reversing direction';);
delay(500);
gotoxy(1,14); cprintf('; ';);
gotoxy(1,7);
if(DR == 0) {
DR = 8;
} else {
DR = 0;
};
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 113 : /* hit the q key */
OE = 16;
outportb(PORTA, OE);
clrscr();
Selection(PORTA, StepsPerRev, DR);
break;
default : break;
};
} while (1);
}; /* end of Continuous */
void StepTheMotor(int PORTA, int DR, int WaitSomeTime) {
int i;
int SI = 4;
int OE = 0;
int FixedTime = 100; /* 100 msec */
outportb(PORTA, SI + DR + OE);
SI = 0;
OE = 0;
delay(FixedTime-WaitSomeTime); /* 100 msec */
outportb(PORTA, SI + DR + OE);
return;
}; /* --- end of StepTheMotor --- */trilogy
I've heard this is possible and now I'd like to do it. I've been told that I can build, on a breadboard, a controller device that would let my computer control a motor connected to a battery (and tell it to run forwards, backwards, and at a variable speed). Does anyone know how to do this specifically (we can talk about it through E-mails or IM) or a site that has instructions for how to do this? If my computer could ';talk'; to the board through my USB or Modem, that would be great. As for programming, I'd like to use JAVA or C, if that makes any difference.
ThanksComputer controlling a DC motor...?
Stepper Motor (including circuitry)
Intel 8255 PC interface card
/*
FILE: STEPPER.C Adapted from Stepper.c by P.Oh
DESC: Speed and Positioning options for Stepper Motor
Port A has 5 lines attached and described as follows:
OP = PHASE Line A.0 1 enable / 0 disable
HS = HALF STEP Line A.1 2 enable / 0 disable
SI = STEP INPUT Line A.2 4 enable / 0 disable
DR = DIRECTION Line A.3 8 enable / 0 disable
OE : OUTPUT ENABLE Line A.4 16 enable / 0 disable
*/
#include%26lt;stdio.h%26gt;
#include%26lt;stdlib.h%26gt;
#include%26lt;dos.h%26gt; /* outportb, inportb defined here */
#include%26lt;conio.h%26gt; /* formatted text functions defined here */
void StepTheMotor(int, int, int);
void Selection(int, int, int);
void MoveToFixedAngle(int, int, int);
void Continuous(int, int, int);
void main(void) {
int Sgnal;
int BASEADDR;
int PORTA, PORTB, PORTC;
int CNTRL;
int Choice;
int StepsPerRev;
int DR = 0;
clrscr(); /* clear screen */
window(5,5,75,30); /* set up text window */
gotoxy(1,1);
cprintf(';Enter Base Address (decimal) e.g. 608\n';);
gotoxy(1,2); scanf(';%d';, %26amp;BASEADDR);
PORTA = BASEADDR;
PORTB = BASEADDR + 1;
PORTC = BASEADDR + 2;
CNTRL = BASEADDR + 3;
outportb(CNTRL, 128); /* configure all ports for output */
outportb(PORTB, 0); /* Ports B and C not used, so just set to 0 */
outportb(PORTC, 0);
StepsPerRev = 96;
Selection(PORTA, StepsPerRev, DR);
} /* end of main */
void Selection(int PORTA, int StepsPerRev, int DR) {
/* Motor speed and position options */
int DegPerStep;
int Choice;
clrscr();
gotoxy(1,4); cprintf(';Motor requires %d steps per rev\n';, StepsPerRev);
DegPerStep = (int)(360 / StepsPerRev);
gotoxy(40,4); cprintf('; =%26gt; thus 1 step = %d degrees\n';, DegPerStep);
do {
gotoxy(1,6); cprintf(';(1) To rotate to a certain angle clockwise\n';);
gotoxy(1,7); cprintf(';(2) To rotate to a certain angle counter-clockwise\n';);
gotoxy(1,8); cprintf(';(3) To rotate continuously - with speed options\n';);
gotoxy(1,9); cprintf(';(4) To quit\n';);
gotoxy(1,10); cprintf(';Selection =%26gt;\n';);
gotoxy(14,10); scanf(';%d';, %26amp;Choice);
switch(Choice) {
case 1 : DR = 0;
MoveToFixedAngle(PORTA, DR, DegPerStep);
break;
case 2 : DR = 8;
MoveToFixedAngle(PORTA, DR, DegPerStep);
break;
case 3 : Continuous(PORTA, DR, StepsPerRev);
break;
case 4 : outportb(PORTA, 16); /* shutdown all signals */
gotoxy(1,22); cprintf(';Quitting\n';);
exit(0);
default : gotoxy(1,14); cprintf(';Choose 1, 2, 3, or 4\n';);
break;
}; /* end select */
} while (1); /* can only exit Selection if user selects 4 */
}; /* end of Selection */
void MoveToFixedAngle(int PORTA, int DR, int DegPerStep) {
int Degrees;
int NumberOfSteps;
char *GetKey[2];
int WaitSomeTime = 0;
int i;
clrscr();
if(DR == 0) {
gotoxy(1,4); cprintf(';Will step CW fixed number of degrees\n';);
} else { /* DR is 8 */
gotoxy(1,4); cprintf(';Will step CCW fixed number of degrees\n';);
};
gotoxy(1,5); cprintf(';Enter number of degrees =%26gt; ';);
gotoxy(28,5); scanf(';%d';, %26amp;Degrees);
gotoxy(1,7); cprintf(';Will step %d degrees';, Degrees);
gotoxy(1,8); cprintf(';Hit a key to start';);
while (!kbhit());
NumberOfSteps = (int)(Degrees / DegPerStep);
for(i = 1; i %26lt;= NumberOfSteps; i++) {
StepTheMotor(PORTA, DR, WaitSomeTime);
};
gotoxy(1,10); cprintf(';Finished!';);
gotoxy(1,11); cprintf(';Hit a key then %26lt;ENTER%26gt; to do another angle';);
gotoxy(42,11); cprintf(';or q then %26lt;ENTER%26gt; to quit to main menu';);
scanf(';%s';, %26amp;GetKey);
if(GetKey[0] == 'q' || GetKey[0] == 'Q') {
clrscr();
return;
} else {
MoveToFixedAngle(PORTA, DR, DegPerStep);
};
}; /* end of MoveToFixedAngle */
void Continuous(int PORTA, int DR, int StepsPerRev) {
int WaitSomeTime;
int TapKey;
int SpeedGrade;
int OE;
clrscr();
gotoxy(1,2); cprintf(';Tap a key:';);
gotoxy(1,3); cprintf(';(f)aster';);
gotoxy(1,4); cprintf(';(s)lower';);
gotoxy(1,5); cprintf(';(r)everse';);
gotoxy(1,6); cprintf(';(q)quit to main menu';);
gotoxy(1,7);
WaitSomeTime = 0;
SpeedGrade = 1;
do {
do {
StepTheMotor(PORTA, DR, WaitSomeTime);
} while(!kbhit());
TapKey = getch();
switch(TapKey) {
case 102 : /* hit f key */
WaitSomeTime = WaitSomeTime + 5;
if(WaitSomeTime %26gt;= 100) {
WaitSomeTime = 100;
gotoxy(1,10); cprintf(';Can't go faster';);
SpeedGrade = 20;
} else {
gotoxy(1,10); cprintf(';Going faster...';);
SpeedGrade = SpeedGrade + 1;
};
gotoxy(1,12); cprintf(';speed grade = %2d';, SpeedGrade);
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 115 : /* hit s key */
WaitSomeTime = WaitSomeTime - 5;
if(WaitSomeTime %26lt;= 0) {
WaitSomeTime = 0;
gotoxy(1,10); cprintf(';Won't go slower';);
SpeedGrade = 0;
} else {
gotoxy(1,10); cprintf(';Going slower...';);
SpeedGrade = SpeedGrade - 1;
};
gotoxy(1,12); cprintf(';speed grade = %2d';, SpeedGrade);
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 114 : /* hit the r key */
gotoxy(1,14); cprintf(';Reversing direction';);
delay(500);
gotoxy(1,14); cprintf('; ';);
gotoxy(1,7);
if(DR == 0) {
DR = 8;
} else {
DR = 0;
};
StepTheMotor(PORTA, DR, WaitSomeTime);
break;
case 113 : /* hit the q key */
OE = 16;
outportb(PORTA, OE);
clrscr();
Selection(PORTA, StepsPerRev, DR);
break;
default : break;
};
} while (1);
}; /* end of Continuous */
void StepTheMotor(int PORTA, int DR, int WaitSomeTime) {
int i;
int SI = 4;
int OE = 0;
int FixedTime = 100; /* 100 msec */
outportb(PORTA, SI + DR + OE);
SI = 0;
OE = 0;
delay(FixedTime-WaitSomeTime); /* 100 msec */
outportb(PORTA, SI + DR + OE);
return;
}; /* --- end of StepTheMotor --- */
Besides Jan. 2001 to Jan. 2007, when else has any party totally controlled Washington DC?
With the VP's vote, the Senate was in Republican control until Jan. 2007.Besides Jan. 2001 to Jan. 2007, when else has any party totally controlled Washington DC?
Jimmy Carter led a Democratically controlled Senate and House.
If I'm not mistaken, so did Kennedy and Johnson.Besides Jan. 2001 to Jan. 2007, when else has any party totally controlled Washington DC?
Too bad there wasnt any b!tching about spending for those six years.
Jimmy Carter led a Democratically controlled Senate and House.
If I'm not mistaken, so did Kennedy and Johnson.Besides Jan. 2001 to Jan. 2007, when else has any party totally controlled Washington DC?
Too bad there wasnt any b!tching about spending for those six years.
Subscribe to:
Posts
(Atom)