Skip to content

Instantly share code, notes, and snippets.

@jarvist
Created September 18, 2014 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarvist/368622717a5d3bcadfc0 to your computer and use it in GitHub Desktop.
Save jarvist/368622717a5d3bcadfc0 to your computer and use it in GitHub Desktop.
for (i=0;i<256;i++)
{
// Alright, this is the plan
// First we take our variable
// Then we bit reverse it as binary
// Pretty confusing, but means it will fill in the temperature
// range with maximum coverage, rather than linear ramping
unsigned char r=i;
r=(r&0xF0)>>4 | (r&0x0F)<<4;
r=(r&0xCC)>>2 | (r&0x33)<<2;
r=(r&0xAA)>>1 | (r&0x55)<<1;
...Do some science...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment