I'm trying to program a msp430 to change a variable to change the velocity of a blinking led. This is my first try. How do I execute the subroutine "changeVelocity" when the button is pressed?
bic.b #00001000b, &P2DIR ; P2.3 as input
bis.b #1,&P1DIR ; P1.0 as output
bis.b #00001000b, &P2REN ; select internal resistor
bis.b #00001000b, &P2OUT ; make it pull-up
main:
xor.b #1,&P1OUT ; Toggle P1.0
call #ExtraDelay
bit.b #00001000b, &P2IN ;poll 2.3 (trying to detect the button)
jz changeVelocity ;this is how I'm trying but do not work as expected.
jmp main