Reverse engineering characters to ascii


so i've got code (see below) turns characters ascii, works great want make turns ascii characters i'm completly lost. if tell me how modify code or me (i wont mind ;) ) great.

code: [select]
void setup()

{
  serial.begin(9600);

  char string[] = "abd";
  char buffer[4 * sizeof(string)];
  char* buffptr = buffer;

  (byte = 0; < sizeof(string) - 1; i++) {
    itoa((int)string[i], buffptr, 10);
    buffptr += strlen(buffptr);
    *buffptr = ' ';
    buffptr++;
  }
  buffptr--;
  *buffptr = '\0';
  serial.println(buffer);

}

void loop()

{

}

in code above use itoa() convert int ascii


you can use opposite function atoi() go other way



Arduino Forum > Using Arduino > Programming Questions > Reverse engineering characters to ascii


arduino

Comments

Popular posts from this blog

Valutazione Template - Joomla! Forum - community, help and support

SD Datastring Convention

First use of Arduino Uno : avrdude error on Blink uploading