Skip to main content

Can iI use string and int in Serial.println together?

I just yesterday started programming on arduinoArduino, and I have a little problem.

I want to print "#S|SKAITYMAS|[1]#" in one line, except instead of "1" I would like to use an int value. However, this one doesn't work  :   

Serial.println ("#S|SKAITYMAS|[",LINENR,"]#"); 

Any hint or tips would be appreciated.

Can i use string and int in Serial.println together?

I just yesterday started programming on arduino, and I have a little problem.

I want to print "#S|SKAITYMAS|[1]#" in one line, except instead "1" I would like to use int value. However, this one doesn't work  :  Serial.println ("#S|SKAITYMAS|[",LINENR,"]#"); Any hint or tips would be appreciated.

Can I use string and int in Serial.println together?

I just yesterday started programming on Arduino, and I have a little problem.

I want to print "#S|SKAITYMAS|[1]#" in one line, except instead of "1" I would like to use an int value. However, this one doesn't work: 

Serial.println ("#S|SKAITYMAS|[",LINENR,"]#"); 

Any hint or tips would be appreciated.

Source Link
Mantvydas
  • 21
  • 1
  • 1
  • 3

Can i use string and int in Serial.println together?

I just yesterday started programming on arduino, and I have a little problem.

I want to print "#S|SKAITYMAS|[1]#" in one line, except instead "1" I would like to use int value. However, this one doesn't work : Serial.println ("#S|SKAITYMAS|[",LINENR,"]#"); Any hint or tips would be appreciated.