EasyManua.ls Logo

Texas Instruments MSP430

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
412
In the main loop, the Launchpad’s green LED (P4_7) is toggled at a given flash rate. When the onboard
user push button (P2_1) is pressed, the onboard red LED (P1_0) is briefly turned on and the rate of
green LED’s flashing is altered.
if(GPIO_getInputPinValue(GPIO_PORT_P2, GPIO_PIN1) == false)
{
while(GPIO_getInputPinValue(GPIO_PORT_P2, GPIO_PIN1) == false);
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
delay_ms(100);
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
s = ~s;
}
P4OUT ^= BIT7;
switch(s)
{
case 0:
{
delay_ms(100);
break;
}
default:
{
delay_ms(600);
break;
}
}
Demo
Demo video: https://youtu.be/ppgQP661JDw.

Table of Contents

Other manuals for Texas Instruments MSP430

Related product manuals