char data to uint8_t for CRC

Yeah, but why do you have stupid named variables like d1, d2, d3 and d4 in the fist place????

hahaha yeh i see ya point so i should change them to value1 value2 value3 value4 ?

Certainly not.

Are those values ever going to be different then the array data?

yes they will change

Value1 = Dip switch 1
Value2 = dip Switch 2
Value3 = sensor data 1
Value4 = sensor data 2

Then why don't you call them that?! That would be at least kind of useful...

And data isn't suppose to change then?

I'm trying to convert char data to uint8_t for CRC but cant find any examples for doing this.

Unless I'm missing something, this is because converting char to uint8_t is trivial; in most C compilers, they're both aliases for the same fundamental data type (a byte of memory.) All the effort you're going through to convert to a string first is probably wasted; all you should need is:

result = CRC8((uint8_t *)data1, 4);

(at least, for "typical" networking protocols and uses of CRC. And the cast is just to keep the compiler from issuing a warning message...)

Indeed, that's part of what I'm saying. He's trying to fix a problem that's not there. And in the process of it creates a whole load of crappy named variables he don't need...