Skip to main content

I was having some problems on a project, so to test my arduinoArduino, iI wrote the following program to check things. When I start the Serial Monitorserial monitor, the value of i is 1.But, but after I start sending numbers, they change into ASCII. Why?

int i = 1;
void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(i);
  if(Serial.available()){
    i = Serial.read();
  }
}
int i = 1;
void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(i);
  if(Serial.available()){
    i = Serial.read();
  }
}

I was having some problems on a project, so to test my arduino, i wrote the following program to check things. When I start the Serial Monitor, the value of i is 1.But after I start sending numbers, they change into ASCII. Why?

int i = 1;
void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(i);
  if(Serial.available()){
    i = Serial.read();
  }
}

I was having some problems on a project, so to test my Arduino, I wrote the following program to check things. When I start the serial monitor, the value of i is 1, but after I start sending numbers, they change into ASCII. Why?

int i = 1;
void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(i);
  if(Serial.available()){
    i = Serial.read();
  }
}
Source Link

Serial.read(): Value changes to ASCII when I input from Serial Monitor

I was having some problems on a project, so to test my arduino, i wrote the following program to check things. When I start the Serial Monitor, the value of i is 1.But after I start sending numbers, they change into ASCII. Why?

int i = 1;
void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(i);
  if(Serial.available()){
    i = Serial.read();
  }
}