RuiViana

varLength.ino

Sep 18th, 2020
743
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup() {
  2.   Serial.begin(115200);
  3.  
  4.   unsigned int var1 = 0xFFFE;
  5.   unsigned int var2 = 0xFFFFFFFE;
  6.   unsigned long var3 = 0xFFFFFFFE;
  7.   unsigned long var4 = 0xFFFFFFFFFFFFFFFE;
  8.   uint64_t var5 = 0xFFFFFFFFFFFFFFFE;
  9.   float var6 = 122.3 / 3333.3;
  10.  
  11.   Serial.println("  ");
  12. #ifdef ESP8266
  13.   Serial.println("ESPxxx");
  14.   printf("var1 int = %u\n", var1);
  15.   printf("var2 int = %u\n", var2);
  16.   printf("var3 long = %u\n", var3);
  17.   printf("var4 long = %u\n", var4);
  18.   printf("var long long = %u\n", var5);
  19.   printf("var6 float = %2.16f\n", var6);
  20.  
  21. #else
  22.   Serial.println("Arduino ");
  23.  
  24.   Serial.print("var1 int "); Serial.println(var1);
  25.   Serial.print("var2 int "); Serial.println(var2);
  26.   Serial.print("var3 long "); Serial.println(var3);
  27.   Serial.print("var4 long "); Serial.println(var4);
  28.   Serial.println("não imprime formato long long");
  29.   Serial.print("var6 float "); Serial.println(var6, 16);
  30. #endif
  31. }
  32.  
  33. void loop() {
  34.   ;
  35.  
  36. }
RAW Paste Data