Skip to content

Instantly share code, notes, and snippets.

@matrixd
Created July 13, 2014 00:14
Show Gist options
  • Save matrixd/a5823215d36d55b9c53c to your computer and use it in GitHub Desktop.
Save matrixd/a5823215d36d55b9c53c to your computer and use it in GitHub Desktop.
Ascii string to uint
uint8_t strToUint8(uint8_t length, uint8_t *charseq){
uint8_t res = 0;
uint8_t n = 0;
while(length) {
length -= 1;
res += charseq[n] - 0x30 + (length*10);
n++;
};
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment