user13355: I'm trying to rename pins so that they post as some kind of alpha-numeric combination in a database.  For example, if I define the following....
#define APLHA 0
#define BRAVO 2
#define CHARLIE 5
#define DELTA 6

...I would like to rename the output of the pins, as recorded in the db, as something other than 0, 2, 5, and 6 (or whatever pin is used). Let's say A, B,C, and D for the purposes of this exercise.
Is this just as simple as creating if() function that is called upon prior to posting to the db (ex. if 0 then A, if 2, then B, etc)?  I feel like there must be a better, dare I say more elegant(?), way of doing this?
Current output:
PIN | VALUE
0  |   1
 2  |   1
 5  |   0
 6  |   0
Desired:
PIN | VALUE
 A  |   1
 B  |   1
 C  |   0
 D  |   0

user20696: If I understood your question correctly, you're looking for something like this:  
static const byte PIN_NUMBER[4] = { 0, 2, 5, 6 };
static const char *PIN_NAME[4] = { "A", "B", "C", "D" };

// and use them like this:

void Log(byte index)
{
  byte val = digitalRead(PIN_NUMBER[index]);
  Serial.print(PIN_NAME[index]);
  Serial.print('|');
  Serial.println(val);
}

void setup()
{
  for (byte i = 0; i < 4; ++i) pinMode(PIN_NUMBER[i], INPUT);
}

void loop()
{
  Serial.println("PIN|VALUE");
  for (byte i = 0; i < 4; ++i) Log(i);
  delay(1000);
}

Also, in the special case of "A", "B", "C", "D" as pin names, you don't really need the PIN_NAME array, instead of  
Serial.print(PIN_NAME[index]);

you can use:  
Serial.print('A' + index);


13355: <p>I'm trying to rename pins so that they post as some kind of alpha-numeric combination in a database.  For example, if I define the following....</p>

<pre><code>#define APLHA 0
#define BRAVO 2
#define CHARLIE 5
#define DELTA 6
</code></pre>

<p>...I would like to rename the output of the pins, as recorded in the db, as something other than 0, 2, 5, and 6 (or whatever pin is used). Let's say A, B,C, and D for the purposes of this exercise.</p>

<p>Is this just as simple as creating if() function that is called upon prior to posting to the db (ex. if 0 then A, if 2, then B, etc)?  I feel like there must be a better, dare I say more elegant(?), way of doing this?</p>

<p>Current output:<br>
PIN | VALUE<br>
0  |   1<br>
 2  |   1<br>
 5  |   0<br>
 6  |   0<br></p>

<p>Desired:<br>
PIN | VALUE<br>
 A  |   1<br>
 B  |   1<br>
 C  |   0<br>
 D  |   0<br></p>
 20696: <p>If I understood your question correctly, you're looking for something like this:  <br></p>

<pre><code>static const byte PIN_NUMBER[4] = { 0, 2, 5, 6 };
static const char *PIN_NAME[4] = { "A", "B", "C", "D" };

// and use them like this:

void Log(byte index)
{
  byte val = digitalRead(PIN_NUMBER[index]);
  Serial.print(PIN_NAME[index]);
  Serial.print('|');
  Serial.println(val);
}

void setup()
{
  for (byte i = 0; i &lt; 4; ++i) pinMode(PIN_NUMBER[i], INPUT);
}

void loop()
{
  Serial.println("PIN|VALUE");
  for (byte i = 0; i &lt; 4; ++i) Log(i);
  delay(1000);
}
</code></pre>

<p>Also, in the special case of "A", "B", "C", "D" as pin names, you don't really need the <code>PIN_NAME</code> array, instead of  <br></p>

<pre><code>Serial.print(PIN_NAME[index]);
</code></pre>

<p>you can use:  <br></p>

<pre><code>Serial.print('A' + index);
</code></pre>
