SHARE
TWEET

Untitled

a guest Feb 20th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uint8_t d_1, d_2, d_3, d_4, d_5, p_1, p_2;
  2.  
  3.     d_1 = ((float) (myFloat) / 10000);
  4.     d_2 = ((float) (myFloat) / 1000) - d_1 * 10;
  5.     d_3 = ((float) (myFloat) / 100) - d_1 * 100 - d_2 * 10;
  6.     d_4 = ((float) (myFloat) / 10) - d_1 * 1000 - d_2 * 100 - d_3 * 10;
  7.     d_5 = ((float) (myFloat)) - d_1 * 10000 - d_2 * 1000 - d_3 * 100 - d_4 * 10;
  8.  
  9.     float interFloat = (float) myFloat - (int) myFloat;
  10.     uint16_t fractional_part = (float) interFloat * 100;
  11.  
  12.     p_1 = ((float) (fractional_part) / 10);
  13.     p_2 = ((float) (fractional_part)) - p_1 * 10;
  14.  
  15.     //Font_Coordinate(X,Y);
  16.     unsigned char d_1c, d_2c, d_3c, d_4c, d_5c, p_1c, p_2c;
  17.     d_1c = '0' + d_1;
  18.     d_2c = '0' + d_2;
  19.     d_3c = '0' + d_3;
  20.     d_4c = '0' + d_4;
  21.     d_5c = '0' + d_5;
  22.     p_1c = '0' + p_1;
  23.     p_2c = '0' + p_2;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top