LE : Solution (not so elegant, but working) :
Code:Main: ;reading buttons on row 1 PortA.0 = 0 TrisA.1 = 1 pause 10 if porta.2 = 0 then portb.1 = 1 while porta.2=0 : wend portb.1 = 0 endif if porta.3 = 0 then portb.2 = 1 while porta.3=0 : wend portb.2 = 0 endif if porta.4 = 0 then portb.3 = 1 while porta.4=0 : wend portb.3 = 0 endif PortA.0 = 1 TrisA.1 = 0 ;reading buttons on line 2 Portb.0 = 0 TrisA.1 = 1 pause 10 if porta.2 = 0 then portb.4 = 1 while porta.2=0 : wend portb.4 = 0 endif if porta.3 = 0 then portb.5 = 1 while porta.3=0 : wend portb.5 = 0 endif if porta.4 = 0 then portb.6 = 1 while porta.4=0 : wend portb.6 = 0 endif Portb.0 = 1 TrisA.1 = 0 Goto main




Bookmarks