Logarithmic scaling for LED dimming?

That's what I had in mind. And you can get the compiler to work out the number of items in the array:

// number of items in an array
#define NUMITEMS(arg) ((unsigned int) (sizeof (arg) / sizeof (arg [0])))

int vals [] = { 256, 230, 200, 150, 100, 50, 10 };
int numVal = NUMITEMS (vals); //number of values in array