I'm pretty new to the Arduino and I don't know C very well either.
So, my problem I that when I send things over serial to the Arduino, each letter is converted to decimal. Is there a way to either not have it be converted to decimal, or a function that can convert decimal to ascii.
How are you sending things over the Serial? And what exactly are you sending? Could you post some code, using the "#" button above.
I'm just using the serial monitor to send and receive data for now.
I'm sending strings to the Arduino then sending that string back, but when I get it back its in decimal.
Heres the code to explain:
int green = 13;
int blue = 12;
int red = 11;
int ibyte1 = 0;
int ibyte2 = 0;
void setup() {
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
pinMode(red, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
ibyte1 = Serial.read();
ibyte2 = Serial.read();
Serial.print(ibyte1)
if (ibyte1 == 103) {
if (ibyte1 == 110) {
digitalWrite(green, HIGH);
}else{
digitalWrite(green, LOW);
}
}
}
This checks for the letter 'g' then the letter 'n'(for green and on), but if i want to check for full words it gets much more complicated.