and the IF THEN statement will have to be modify.
to something like thatCode:IF (PORTB.2 = 0) AND (PORTB.3 = 0) AND (PORTB.6 = 0) AND (PORTB.4 = 0) AND (PORTB.5 = 1) Then CounterStop = 9: GoTo Horn_Loopsin case you don't modify, PBP will not execute the GOTO Horn_Loops statement.Code:IF (PORTB.2 = 0) AND (PORTB.3 = 0) AND (PORTB.6 = 0) AND (PORTB.4 = 0) AND (PORTB.5 = 1) Then CounterStop = 9 GoTo Horn_Loops endif
Input/output statements are great, but i'll prefer to use only TRIS and comment it on the right like
it's my own opinion. I can agree it can be a bit more readable when using Input/Output statement.Code:TRISA=%10101010 'PORTA definition 'Input on bits : 1,3,5,7 'output on bits : 0,2,4,6




Bookmarks