Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. char PingTime[6] = "3ms";
  2. char PingText[60] = "ping reply blah blah";
  3. float humidity = "40.56";
  4. int DigialPin = 0;
  5.  
  6. PrintXMLTag(cl,"pingtime",PingTime);
  7. PrintXMLTag(cl,"PingText",PingText);
  8. PrintXMLTag(cl,"humidity",humidity);
  9. PrintXMLTag(cl,"DigialPin",DigialPin);
  10.  
  11. void PrintXMLTag_DEC(EthernetClient cl, const char* tag, NotSure?? val)
  12. {
  13. char tmp [100];
  14. StrClear(tmp,100);
  15.  
  16. // If val type is float ----------------------
  17. int d1 = val; // Get the integer part
  18. float f2 = val - d1; // Get fractional part
  19. int d2 = trunc(f2 * 10000);// Turn into integer
  20. sprintf(tmp,"<%s>%d.%02d</%s>n",tag,d1,d2,tag);
  21. // end float
  22.  
  23. // If val type is string ----------------------
  24.  
  25. // If val type is int ----------------------
  26.  
  27. // If val type is char ----------------------
  28.  
  29. cl.print(tmp);
  30. }
  31.  
  32. template <typename SomeType>
  33. SomeType sum (SomeType a, SomeType b)
  34. {
  35. return a+b;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement