I'm trying to Blink and LED while Im holding a switch on the board, my initial code for blinking when the switch is on works fine. but now I'm trying to blink it while I'm holding the switch here is what I have for code, Can any one help point out where my error is, Thanks
#include <project.h>
int main()
{
uint8 SW_Stat;
for(;;)
{
SW_Stat=(SW1_Read());
while(SW_Stat==1)
LED_Write(1);
CyDelay(500);
LED_Write(0);
CyDelay(350);
LED_Write(1);
CyDelay(260);
return 0;
}
}