Advertisement
Guest User

Untitled

a guest
May 21st, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. void carregarCartoesCadastrados() {
  2. Serial.println("Carregando cartoes cadastrados...");
  3.  
  4. for (int i = 0; i < 1024; i++) {
  5. int aux = EEPROM.read(i);
  6.  
  7. if (aux != 255) {
  8.  
  9. String cartao = "";
  10. char auxChar;
  11. int espacoBranco = 0;
  12.  
  13. do {
  14. auxChar = char(EEPROM.read(i));
  15.  
  16. cartao = cartao + auxChar;
  17.  
  18. //Colocar " " (espaço em branco) a cada 2 letras
  19. espacoBranco ++;
  20. if (espacoBranco >= 2) {
  21. cartao = cartao + " ";
  22. espacoBranco = 0;
  23. }
  24. i++;
  25. } while (auxChar != ';');
  26. i--;
  27.  
  28. cartoesCadastrados = cartoesCadastrados + cartao;
  29. Serial.print("Cartao: ");
  30. Serial.println(cartao);
  31.  
  32. Serial.print("Lista de Cartoes: ");
  33. Serial.println(cartoesCadastrados);
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement