I have a device that returns RGB color in serial everything is working except it returns it in Hexadecimal here is a example of what I get out of the serial monitor.
09102803E
code below (I did not make code got it online)
#include <SoftwareSerial.h>
SoftwareSerial Color90(2, 3);
/*====================================================
/ Connect ColorPAL SIG signal to Arduino pin 2 and 3
/ Baud Rate = 9600 kbps
/
/====================================================*/
void setup()
{
pinMode(11, OUTPUT);
Serial.begin(9600);
Color90.begin(4800);
pinMode(2,INPUT);
pinMode(3,INPUT);
digitalWrite(2,HIGH); // Enable the pull-up resistor
digitalWrite(3,HIGH); // Enable the pull-up resistor
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
digitalWrite(2,LOW);
digitalWrite(3,LOW);
pinMode(2,INPUT);
pinMode(3,INPUT);
Serial.println("Pass 1");
while( digitalRead(2) != HIGH || digitalRead(3) != HIGH ) {
Serial.println("In the loop");
delay(50);
}
Serial.println("Pass 2");
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
digitalWrite(2,LOW);
digitalWrite(3,LOW);
delay(80);
pinMode(2,INPUT);
pinMode(3,OUTPUT);
delay(100);
}
//---------------------------------
void loop()
{
char rByte[9];
Color90.begin(4800);
Color90.print("= (00 $ m) !");// Color90.print("= rFFFFFF !");
pinMode(3,INPUT);
rByte[0] = Color90.read();
if( rByte[0] == '
) {
for(int i=0; i<9; i++) {
rByte[i] = Color90.read();
Serial.print(rByte[i]);
digitalWrite(11, HIGH);
}
Serial.println();
}
delay(500);
digitalWrite(11, LOW); // set the LED off
}