convert byte to int

Hi,
I'm sending to Arduino some numbers, but they are sended as byte. To recieve, I have

if(Serial.available())
  {
    int bytes = Serial.available();
    for(int i=0;i<bytes;i++)
    {
      recdata[i]=Serial.read();
      checkdata();
    }

  }

so I should have array, which have in it 8 bytes(begin,from,to,R,G,B,check,end) and I need to convert some of the bytes to int to could write them to LED strip. I tried

int fromLED = recdata[1].toInt();
    int toLED = recdata[2].toInt();
    int red = recdata[3].toInt();
    int greeen = recdata[4].toInt();
    int blue = recdata[5].toInt();
    int checksum = recdata[6].toInt();

but this is not working. I get error

request for member 'toInt' in 'recdata[1]', which is of non-class type 'byte'

How can I convert them to int?
Thanks.
(sorry for my english)

int fromLED = recdata[1];
int toLED = recdata[2];
...

Note that the first byte of recdata[] is recdata[0]

Serial.read() already returns its value as an int, so no need to do any conversions.

Jremington already gave you the other part I was going to say.

First is recdata[0], but recdata[0] is 98 (value of "b" as begin) and it it checked in if statement. recdata[1] is second value, beginning LED :slight_smile:

Note that the first byte of recdata[] is recdata[0]