|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
why does aux1 doesn't work?
Here is the code and from some reason doesn't work.
Code:
if(p1_sw_aux1==1)
{
g=1;
}
if(g==1)
{
z++;
}
if((z<=30)&&(a==1))
{
relay1_fwd=1;
}
else
a=0;
|
|
#2
|
||||||
|
||||||
|
Re: why does aux1 doesn't work?
First of all, it would help if you explained what you wanted the code to do. Secondly, it would help to describe what you've proven works or doesn't work. For example, have you used this code with another switch and it worked correctly? Have verified that p1_sw_aux1 doesn't switch, or do you not really know?
If I had to guess at what the problem is with no other information, I'd say that z (and maybe some of the other variables, depending on the rest of your code) are not declared static. |
|
#3
|
|||
|
|||
|
Re: why does aux1 doesn't work?
I tried to turn the Globe engine for 0.8 seconds when I press aux1.
Appearently, it doesn't work even the variables are declered as static. Is the code correct? |
|
#4
|
||||
|
||||
|
Re: why does aux1 doesn't work?
is "a" initialized as 1?
As a side note, Code:
if(g==1)
{
z++;
}
Code:
if(g) z++; |
|
#5
|
|||||
|
|||||
|
Re: why does aux1 doesn't work?
I'm working with him on the code and a is intializied as 1. Should all the int varibles be static?
|
|
#6
|
|||||
|
|||||
|
Re: why does aux1 doesn't work?
Quote:
What does happen when you press aux1? Does the Globe motor start running and never stop? There is nothing in your code to turn it off after the time has elapsed. |
|
#7
|
|||
|
|||
|
Re: why does aux1 doesn't work?
do you have aux1 defined in your header file? check to see if it is going to the right place and not into a different file. Recheck your variables and make sure your definitions are what you want them to be.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why doesn't this work??!??!!?!!!?!? | HuskieRobotics | Programming | 13 | 05-03-2004 00:20 |
| Arrrrrrrg... PM alert doesn't work | DanL | CD Forum Support | 9 | 08-05-2003 14:32 |
| Edit doesn't work on original title posts??? | Elgin Clock | CD Forum Support | 6 | 12-03-2003 17:30 |
| Robot reset on OI doesn't work | Carl Owenby | General Forum | 1 | 07-02-2003 07:23 |
| sensor doesn't work | PBoss | Programming | 7 | 29-01-2003 18:39 |