rfreader

#include<reg51.h>
void boud_rate()
{
        SCON = 0x50;
        TMOD = 0x20;                /* timer 1, mode 2, 8-bit reload */
        TH1  = 0xFD;                /* reload value for 2400 baud */
        TR1  = 1;
        TI   = 1;
}
char serial_receive()
{
    char chr;        /* variable to hold the new character */
        while (RI != 1) {;}
        chr = SBUF;
        RI = 0;
        return(chr);
}

void main(void)
{

        boud_rate();
  unsigned char rx_data;

  for(;;)
  {
    rx_data = serial_receive();

    switch(rx_data)
    {
//      case '1': open_door();
          case 0067892341 : open_door();
        break;
//      case '9': open_door();
       case 0045780034 : open_door();
        break;

      default: dont_open();
    }

    proper_delay();
  }
}

errors

'rx_data':undefined identifier
 illigal octal digit

please tell me how to overcum these errors

Parents Reply
  • from http://www.saleae.com/logic :"A large fraction of practical, real world applications run at less than 10MHz, and Logic is ideal for these"
    When did you last see an enbedded app running at less than 10MHz? Of course if you were to buy something for the sole purpose of seeing your UART output, the thingy would be OK.
    when salespeople are pushing new stuff they speak of "less than 33MHz is outmoded", when they peddle slow stuff they speak as above,

    Erik

    PS I do not know anything that logic (lowercase 'l') is not ideal for.

Children
More questions in this forum