RuiViana

Pointer64bits.ino

Jan 16th, 2019
215
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // https://yoursunny.com/t/2018/PriUint64/
  2. // https://github.com/yoursunny/PriUint64/
  3. #include "PriUint64.h"
  4. byte *ptr1;                         // define o pointer
  5. int *ptr2;
  6. //---------------------------------------------------------------------------
  7. void setup()
  8. {
  9.   Serial.begin(115200);                 // Inicializa serial
  10.   Serial.println(" ");                  // Nova linha
  11.  
  12.   uint64_t valor = 0xABCDEF55FC28C24B;      // Define variavel e carrega com HEX
  13.   Serial.println(PriUint64<HEX>(valor));           // Nova linha
  14.   ptr1 = (byte *)&valor;                  // Carrega o endereco da variavel no pointer
  15.   ptr2 = (int *)&valor;
  16.   Serial.println(*ptr1, HEX);
  17.   ptr1++;
  18.   Serial.println(*ptr1, HEX);
  19.   Serial.println("------");                  // Nova linha
  20.   Serial.println(*ptr2, HEX);
  21.   ptr2++;
  22.   Serial.println(*ptr2, HEX);
  23.  
  24. }
  25. //---------------------------------------------------------------------------
  26. void loop() {
  27. }
RAW Paste Data