Do you want to store the number of buttons pressed while the program is still running? For example you press 1 and then press 2 and 3 while 1 is running.
Do you want to store the number of buttons pressed while the program is still running? For example you press 1 and then press 2 and 3 while 1 is running.
Last edited by CocaColaKid; - 17th August 2005 at 19:06.
tanero,
your code works as designed.
IF RA.0 only is LOW it will read 254 (%11111110)
IF RA.1 only is LOW it will read 253 (%11111101)
IF both RA.0 and RA.1 are LOW it will read 252 (%11111100)
so none of the IF... conditions is TRUE, that's why it is just LOOPing
You may want to check the port bits individually:
If PortA.0=0 THEN...
If PortA.1=0 THEN...
etc.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Answer for CocaColaKid ;
yes i want to store the number of buttons while 1 is working. After release 1 , then stored record will be worked.
Answer for ralph;
your right for guess . after read your post i changed my code as you offer it worked what i expected nearly.
But some other things i want to do .
Example ;
As PORT Bit loop = one of "if" condition is true , its doing its job. while first if working if second condition is true , second wont work and wait for the first one to be released .
I want ; while the first "if" is true and working ; second "if" true cond happened , it will store request and will do after first if released.
Any idea ?
İ thought to use internal eeprom area to store these requests .
is it usefull to use a like query ?
I would say they easist way would be to monitor the buttons when your in the if routines and record the button states. Then once you return to the main loop process what ever value is stored in the variable. This will only work for sequencing one button though.
Bookmarks