How to convert int to string on Arduino?

前端 未结 9 1343
-上瘾入骨i
-上瘾入骨i 2021-01-31 06:32

How do I convert an int, n, to a string so that when I send it over the serial, it is sent as a string?

This is what I have so far:

int ledP         


        
9条回答
  •  迷失自我
    2021-01-31 07:35

    This simply work for me:

    int bpm = 60;
    char text[256];
    sprintf(text, "Pulso: %d     ", bpm);
    //now use text as string
    

提交回复
热议问题