Skip to content

Instantly share code, notes, and snippets.

@maz
Created August 21, 2012 02:13
Show Gist options
  • Save maz/3410668 to your computer and use it in GitHub Desktop.
Save maz/3410668 to your computer and use it in GitHub Desktop.
Temperature Digits Arduino
void loop(){
int digit_0;//tenths
int digit_1;//ones
int digit_2;//tens
int digit_3;//hundreds
//assuming you've got the same getTemp() setup as in the bildr tutorial
float temp=getTemp();
temp*=1.8;
temp+=32;
temp*=100;
int num=(int)temp;
digit_0=num%10;
num/=10;
digit_1=num%10;
num/=10;
digit_2=num%10;
num/=10;
digit_3=num%10;
num/=10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment