Advertisement
RuiViana

separando decimal de float

Jul 29th, 2015
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. int xpto;
  2. float meufloat = 1.29;
  3.  
  4. void setup ()
  5. {
  6. Serial.begin(9600);
  7. }
  8.  
  9. void loop ()
  10. {
  11. xpto = ((int)(meufloat*100)%100);
  12. Serial.println(xpto);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement