I want to convert the string "6867" to the string "hg" and use the arduino serial port to output. 68 is hexadecimal h, 67 is hexadecimal g. How should this be achieved?

  • (I'd probably first start by searching the web for "c convert hex string to ascii string" or similar; this is asked fairly often :) – Dave Newton Jun 13 at 19:29
  • And I googled just that and found stackoverflow.com/questions/5403103/… – chrisl Jun 13 at 19:41
  • 2
    how did you get the 6867 in the first place? – jsotola Jun 13 at 19:55
  • 67 is ASCII code of 'g' in hexadecimal. (it is 6A for 'j') – Juraj Jun 13 at 20:28
  • emm The input used in that answer is char type, not string type – XR8022 Jun 14 at 3:21

Browse other questions tagged or ask your own question.