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)