Other Parts Discussed in Thread: MSP430G2533
I have 4 red led and 4 green leds .In which 3 red and 1 green led glow at a time and it keep on switching after few seconds..now problem is I want add to it that if input signal is given to msp430G2533 at one port,it will turn on one green led corresponding to that input if it is red,and turn on 3 red led ,for a few seconds and then return back to the original task.There are 4 inputs to msp430 and for every input ,task perform by msp is same as above.pls..help in this second part of coding..what changes should i make to the code given below..thanx.
My first part of coding is given below and it is working fine:
#include <msp430G2533.h> // Specific device;
void delay()
{
unsigned int i,j;
for(i=0;i<800;i++)
for(j=0;j<1024;j++);
}
void main()
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
while(1)
{
P1DIR = 0x26;
P2DIR = 0x1f;
P1OUT = 0x22;
P2OUT = 0x0a;
delay();
P1OUT = 0x22;
P2OUT = 0x14;
delay();
P1OUT = 0x02;
P2OUT = 0x13;
delay();
P1OUT = 0x24;
P2OUT = 0x12;
delay();
}
}