Tag Archives: conversion

How to convert integer to string and string to int on Arduino ?

New version of Arduino supports String data type . In this tutorial we will see both integer to string and string to integer conversion. Conversion of integer to string can be done using single line statement.

Example 1: Integer to String Conversion Arduino
int a = 1234;
String myStr;
myStr = String(a);   //Converts integer to string

Example 2: String to Integer conversion Arduino
String val = “1234”;
int result = val.toInt();  //Converts string to integer

Continue reading How to convert integer to string and string to int on Arduino ?