How to convert a byte to int

hello friends i´m traying to control a RGB strip from a movilphone aplication, but i´m having receptions problems because i am not getting the datas correctly

i dont know how convert those 3 data bytes to an array of integers for after maping the values to PWM outputs

iam using this,,
i hope you could help me a little bit please friends :wink:

#include<SoftwareSerial.h>
int tira[3]={6,5,2};
byte leds[3]={0,0,0};
int endLine=10;
char dato;

void setup() {
Serial.begin(9600);
for(byte i=0; i<3;i++){
pinMode(tira*,OUTPUT);*

  • }*

  • }*

void loop() {

  • while(Serial.available()){*
  • dato = Serial.readBytesUntil(endLine,leds,3); *
  • }//i dont know if datas are saving correctly in leds[]*

}

Something is wrong with your code! Halfway through it turned into italics, and it seems to be missing something.

If you read the How to use this forum post, you will know how to fix it.

Please place your code between [code] and [/code]

The result:

#include<SoftwareSerial.h>
int tira[3]={6,5,2};
byte leds[3]={0,0,0};
int endLine=10;
char dato;

void setup() {
  Serial.begin(9600);
  for(byte i=0; i<3;i++){
      pinMode(tira,OUTPUT);
  }
 
  }
 
void loop() {
          while(Serial.available()){
                dato = Serial.readBytesUntil(endLine,leds,3);               
                }//i dont know if datas are saving correctly in leds[]
           
 }

You can change your code and use Serial.println() to send the individual bytes back to the sending application. This will work if the sending application can display the returned data.

void loop() {
  while (Serial.available()) {
    dato = Serial.readBytesUntil(endLine, leds, 3);
    for(int cnt=0;cnt<3;cnt++)
      Serial.println(leds[cnt], HEX);
  }//i dont know if datas are saving correctly in leds[]

}