Guest User

Untitled

a guest
Feb 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #include <Arduboy2.h>
  2. Arduboy2 arduboy;
  3.  
  4. PROGMEM unsigned const int puntos=6;
  5. PROGMEM unsigned const int retardo=100;
  6. PROGMEM const String mensaje="@mmoroca";
  7.  
  8. unsigned int tablaxy[puntos][2];
  9. int i;
  10. char coordenadas[10];
  11.  
  12. void setup() {
  13. arduboy.boot();
  14. //Serial.begin(9600);
  15. randomSeed(analogRead(1));
  16.  
  17. for (i=-16; i<(64-6)/2; i++) {
  18. arduboy.clear();
  19. arduboy.setCursor((128-(mensaje.length()*6))/2, i);
  20. arduboy.print(mensaje);
  21. arduboy.delayShort(retardo/10);
  22. arduboy.display();
  23. }
  24.  
  25. arduboy.delayShort(retardo*10);
  26.  
  27. for (i=0; i<puntos; i++) {
  28. tablaxy[i][0]=random(128);
  29. tablaxy[i][1]=random(64);
  30. }
  31. }
  32.  
  33. void loop() {
  34. arduboy.clear();
  35.  
  36. for(i=0; i<puntos-2; i++) {
  37. arduboy.drawLine(tablaxy[i][0], tablaxy[i][1], tablaxy[i+1][0], tablaxy[i+1][1], WHITE);
  38. }
  39.  
  40. arduboy.delayShort(retardo);
  41.  
  42. for(i=0; i<puntos-1; i++) {
  43. tablaxy[i][0]=tablaxy[i+1][0];
  44. tablaxy[i][1]=tablaxy[i+1][1];
  45. //sprintf(coordenadas,"%d-%d\n", tablaxy[i][0], tablaxy[i][1]);
  46. //arduboy.print(coordenadas);
  47. }
  48. arduboy.display();
  49.  
  50. tablaxy[puntos-1][0]=random(128);
  51. tablaxy[puntos-1][1]=random(64);
  52. }
Add Comment
Please, Sign In to add comment