Projects › Projects › Fastest finger first project › algo for fastest finger first project
February 7, 2011 at 6:47 am
#5443
dagakshay
Participant
here i an writing the algo which might help you out…
*the switches are connected to a port of microcontroller(lets say PORTA)..
*the port A is externally conncted to the pullup array…
* as soon you press any key that particluar pin of portA goes low
code algo:
1) while(PORT A = = oxff);
2) if (PINA.0 = = 0) output user1
elseif (PINA.1 = = 0) output user2
elseif (PINA.2 = = 0) output user3
elseif (PINA.3 = = 0) output user4
elseif (PINA.4 = = 0) output user5
elseif (PINA.5 = = 0) output user6
elseif (PINA.6 = = 0) output user7
elseif (PINA.7 = = 0) output user8
else goto step(1);
3) goto step 1;