turning LEDs ON and OFF of PIC microcontroller by reading data from putty

Submitted by Pic on Tue, 02/05/2019 - 01:04

If "A" is typed in putty, then LED0 of the PIC24FJ128GA010 turns ON. If "99" is ented in putty or any other terminal program, LED1 blinks. Any idea how to do that ?

 

In your case the PIC and computer should have been connected through Serial communication.

Putty is a serial software using which you can send serial data from compter to PIC thorugh COM port.

So all you have to do is write a program on PIC to check for any incoming serial data and based on that you have to control the LED

  Joined August 16, 2016      997
Tuesday at 12:29 AM

I am using this to receive the character entered in putty. But its not working. I am using PIC24FJ128GA010.

void U2_RxByte(void)
{
    while(!(U2STAbits.URXDA));
    if(!(U2STAbits.OERR))
    {
        command = U2RXREG;
        delayFunc();
    }
}

  Joined February 05, 2019      1
Tuesday at 12:39 AM