// PERSISTENCE OF VISION PROJECT
//
#include <Arduino.h>
#include <pgmspace.h>
#include <FastLED.h>
#include <cstdint>
//#include <WiFi.h>
//#include <BLEDevice.h>
//#include <SoftwareSerial.h>
//SoftwareSerial BT(7,8); //10 RX, 11 TX
// Define Pins
#define NUM_STRIPS 3 // Value = 1,2(180),3(120),4(90)
#define NUM_LEDS 30
#define DATA_PIN 16
#define HALL_SENSOR_PIN 36
#define COLOR_ORDER GRB // GRB for simulatiom
#define LED_TYPE WS2812B
const uint8_t radio1directo[] PROGMEM = {1};
const uint8_t offset1[] PROGMEM = {0};
const uint8_t brillo[] PROGMEM = {128};
// Peace
const uint16_t numpasos[] PROGMEM = {152}; // number of steps
const uint16_t angreducido[] PROGMEM = {152}; // angle reduced
const uint16_t sizePolarRedu[] PROGMEM = {684};
const uint8_t PolarRedu[684] PROGMEM = {0,1,0,0,2,7,0,3,7,0,4,7,0,5,7,0,6,7,0,7,7,0,8,7,0,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,0,0,20,0,0,21,0,0,22,0,0,23,0,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,2,8,0,4,2,0,5,3,0,5,7,0,6,6,0,7,4,0,7,5,0,23,5,7,24,6,7,27,4,7,27,7,7,33,8,7,33,26,7,34,25,7,34,27,7,34,28,7,35,3,7,35,24,7,36,23,7,36,29,7,37,22,7,38,21,7,40,20,7,41,19,7,43,9,7,43,18,7,45,17,7,45,29,0,47,16,7,47,28,0,48,27,0,50,15,7,50,26,0,52,25,0,53,14,7,54,24,0,56,23,0,57,13,7,59,22,0,62,1,7,62,12,7,62,21,0,66,20,0,69,11,7,71,19,0,72,9,0,77,18,0,79,3,0,80,10,7,87,17,0,108,17,7,115,2,7,116,10,0,118,18,7,122,9,7,125,19,7,126,4,0,128,11,0,130,20,7,132,10,7,135,12,0,135,21,7,139,22,7,140,11,7,141,3,7,144,23,7,145,5,0,147,24,7,150,13,0,152,25,7,153,13,7,158,4,7,158,26,7,162,11,0,164,6,0,166,27,7,167,12,7,170,10,0,175,5,7,175,9,0,175,11,7,176,8,0,176,28,7,177,7,0,181,10,7,184,16,0,185,9,7,185,15,0,187,6,7,187,8,7,188,14,0,188,16,7,189,8,0,192,15,7,194,13,0,197,7,7,197,14,7,198,9,0,202,28,0,205,8,7,206,10,0,209,27,0,211,12,0,212,9,7,212,11,0,214,26,0,217,13,7,218,10,7,219,12,7,219,25,0,222,11,7,225,24,0,230,23,0,237,22,0,241,21,0,243,20,0,244,19,0,246,18,0,248,17,0,250,16,0,253,15,0,253,17,7,1,14,0,1,16,7,1,17,0,4,13,0,4,15,7,7,12,0,8,14,7,9,11,0,10,8,0,10,9,0,10,10,0,11,5,0,11,6,0,11,7,0,12,13,7,14,4,0,15,4,7,15,12,7,16,4,0,17,11,7,18,3,0,18,10,7,19,9,7,19,16,0,20,16,7,22,2,0,22,7,7,23,16,0,24,16,7,25,6,7,29,5,7,35,4,7,37,1,0,37,17,7,44,9,0,44,18,7,47,3,7,48,19,7,50,8,7,52,20,7,54,10,0,55,21,7,58,22,7,59,11,0,60,23,7,61,9,7,63,12,0,63,24,7,65,25,7,66,13,0,67,26,7,68,27,7,69,14,0,70,28,7,71,15,0,71,29,7,72,10,7,72,30,7,73,2,7,73,16,0,74,17,0,76,18,0,77,19,0,78,20,0,80,21,0,80,22,0,81,23,0,82,24,0,83,25,0,83,26,0,84,27,0,84,28,0,85,29,0,85,30,0,89,10,0,101,9,0};
//Normal
/*const uint16_t numpasos[] PROGMEM = {47};
const uint16_t angreducido[] PROGMEM = {70};
const uint16_t sizePolarRedu[] PROGMEM = {294};
const uint8_t PolarRedu[294] PROGMEM = {0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,0,6,0,0,7,0,0,8,0,0,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,6,0,17,6,0,18,6,0,19,6,0,20,6,0,21,6,0,22,6,0,23,6,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,6,20,0,6,21,0,7,19,0,8,17,4,8,19,6,8,21,6,9,16,0,9,17,0,10,20,6,10,23,0,12,22,0,15,21,0,17,20,0,18,19,4,19,18,0,19,19,0,23,24,2,24,25,2,25,23,2,26,26,2,27,21,2,27,22,2,28,20,2,28,27,2,29,25,0,31,24,0,32,24,2,33,22,0,33,25,2,34,23,0,35,23,2,37,27,0,38,22,2,38,25,0,38,26,0,39,20,0,42,21,0,43,24,0,44,22,0,44,23,0,71,20,3,71,21,3,73,19,3,73,22,3,76,18,3,77,23,3,77,24,3,78,25,3,79,20,0,83,23,0,84,22,0,85,21,0,85,23,3,87,25,0,88,22,3,89,18,0,90,19,0,91,24,0,92,22,0,92,23,0,100,17,6,100,18,6,100,19,6,103,16,6,103,20,6,104,21,6,104,22,6,104,23,6};
*/
// Mirror
//const uint16_t numpasos[] PROGMEM = {47};
//const uint16_t angreducido[] PROGMEM = {58};
//const uint16_t sizePolarRedu[] PROGMEM = {288};
//const uint8_t PolarRedu[288] PROGMEM = {0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,0,6,0,0,7,0,0,8,0,0,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,6,0,17,6,0,18,6,0,19,6,0,20,6,0,21,6,0,22,6,0,23,6,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,2,20,0,2,21,0,2,22,0,2,23,0,3,16,0,5,17,0,5,18,0,5,19,0,13,22,3,13,23,3,15,19,3,15,24,3,17,18,3,18,22,0,19,25,3,20,23,0,21,21,3,22,22,3,23,23,3,26,20,3,28,25,0,29,23,0,29,24,0,30,18,0,32,22,0,33,19,0,34,21,0,35,20,0,62,22,2,62,23,2,63,24,2,64,21,2,67,20,2,68,22,0,68,25,2,68,26,2,69,27,2,70,23,0,72,22,2,72,23,2,73,25,0,77,25,2,78,20,0,78,22,0,78,27,0,79,21,0,80,26,0,81,23,0,82,24,0,82,25,0,87,18,6,87,19,6,88,20,4,89,20,6,91,21,6,94,22,6,95,20,0,96,23,6,97,16,6,97,17,6,98,19,0,98,21,0,99,19,6,99,20,4,100,20,6,100,21,6};
// Smiley
/*const uint16_t numpasos[] PROGMEM = {46};
const uint16_t angreducido[] PROGMEM = {58};
const uint16_t sizePolarRedu[] PROGMEM = {264};
const uint8_t PolarRedu[264] PROGMEM = {0,1,5,0,2,5,0,3,5,0,4,5,0,5,5,0,6,5,0,7,5,0,8,5,0,9,5,0,10,5,0,11,5,0,12,5,0,13,5,0,14,5,0,15,5,0,16,5,0,17,5,0,18,5,0,19,5,0,20,5,0,21,5,0,22,5,0,23,5,0,24,5,0,25,5,0,26,5,0,27,5,0,28,0,0,29,0,0,30,0,17,15,0,18,14,0,18,16,0,18,17,0,19,13,0,19,18,0,21,12,0,21,19,0,23,20,0,25,11,0,28,21,0,33,10,0,38,21,5,45,20,5,50,19,5,53,10,5,53,18,5,56,17,5,58,16,5,59,11,5,60,15,5,61,12,5,62,13,5,62,14,5,98,20,0,99,18,0,99,19,0,100,17,0,6,17,5,7,18,5,7,19,5,8,20,5,46,12,0,46,13,0,47,11,0,47,14,0,48,15,0,50,16,0,51,10,0,52,17,0,55,18,0,58,19,0,63,20,0,64,9,0,68,9,5,72,21,0,78,21,5,80,10,5,83,20,5,84,11,5,86,19,5,87,12,5,88,18,5,89,13,5,89,17,5,90,14,5,90,15,5,90,16,5};
*/
// Cat
/*const uint16_t numpasos[] PROGMEM = {295};
const uint16_t angreducido[] PROGMEM = {844};
const uint16_t sizePolarRedu[] PROGMEM = {2904};
const uint8_t PolarRedu[2904] PROGMEM = {0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,0,6,0,0,7,4,0,8,1,0,9,4,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,0,0,20,0,0,21,0,0,22,0,0,23,0,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,2,9,1,3,7,0,5,8,7,7,7,4,7,10,4,8,7,0,8,8,4,8,10,1,10,9,7,11,9,4,12,8,0,12,9,7,12,11,4,13,11,1,13,12,4,14,9,4,14,13,4,15,9,0,15,10,7,15,12,1,15,14,4,15,15,4,15,17,4,16,13,1,16,14,1,16,16,1,16,17,1,16,18,1,16,19,1,16,20,1,16,21,1,17,10,4,17,15,1,17,17,7,17,20,7,17,21,7,17,22,1,18,11,7,18,16,7,18,18,7,18,19,7,18,22,7,18,23,1,19,11,4,19,15,7,19,17,4,19,19,4,19,20,4,19,23,7,20,10,0,20,12,4,20,13,7,20,14,7,20,16,4,20,18,4,20,21,4,20,22,4,20,24,7,21,15,4,21,18,0,21,19,0,21,20,0,21,21,0,21,22,0,21,23,0,21,24,0,21,25,7,22,11,0,22,16,0,22,17,0,22,18,4,22,25,0,22,26,4,23,13,4,23,16,4,23,18,0,23,24,7,23,25,7,23,26,0,23,27,1,24,12,0,24,14,4,24,16,0,24,17,7,24,25,1,24,26,1,24,28,4,24,29,7,25,17,0,25,23,7,25,24,1,25,28,1,25,29,1,26,13,0,26,14,0,26,15,0,26,16,7,26,23,1,26,29,6,26,30,1,27,13,4,27,14,4,27,15,7,27,16,1,27,22,7,27,25,7,28,14,0,28,16,0,28,22,1,28,23,7,28,25,1,28,28,4,28,29,1,28,30,0,29,13,0,29,21,7,29,22,0,29,25,7,29,26,7,29,28,1,29,29,0,30,21,1,30,23,2,31,21,0,31,24,7,31,26,4,31,28,0,32,14,7,32,22,7,33,22,0,33,23,7,33,26,7,33,27,7,34,20,7,34,25,4,34,27,1,34,28,4,35,15,0,35,20,0,35,23,0,35,24,0,35,25,7,35,28,1,35,29,7,36,25,0,36,28,7,36,29,0,36,30,1,37,26,4,37,28,1,37,29,1,39,13,4,40,15,4,40,22,7,40,26,1,41,12,4,41,14,1,41,16,4,41,26,4,41,30,0,42,22,0,42,23,7,42,26,1,42,29,6,43,12,0,43,16,1,43,22,4,43,23,1,43,24,1,43,25,7,43,29,4,44,14,7,44,16,4,44,17,4,44,22,0,44,24,4,44,25,1,44,29,0,45,14,1,45,19,4,45,20,4,45,24,1,46,14,7,46,22,4,46,30,1,47,13,0,47,14,4,47,19,0,47,22,0,47,24,0,47,25,4,47,26,6,47,28,0,47,30,0,48,17,6,48,21,4,48,22,4,48,26,1,48,28,4,49,13,4,49,15,6,49,28,0,50,12,4,50,15,4,50,16,6,50,18,4,50,24,2,50,25,0,51,12,0,51,16,1,51,19,4,51,21,0,51,22,0,51,23,7,51,27,0,52,21,4,52,25,1,53,15,6,53,16,6,53,19,0,53,21,7,53,26,0,54,15,4,54,19,4,54,22,2,55,15,6,55,17,1,55,18,6,55,19,1,55,20,6,55,21,1,55,22,7,55,23,0,55,24,0,55,25,7,56,12,4,56,18,1,56,19,4,56,21,7,56,25,0,57,21,4,57,22,1,57,23,7,57,24,4,58,16,1,58,19,6,58,20,4,58,21,1,58,24,1,59,19,1,59,20,1,59,21,6,59,23,6,60,14,6,60,20,6,60,23,1,60,25,1,61,18,6,61,20,1,61,21,1,61,25,0,62,17,6,63,11,4,63,17,1,63,19,4,63,22,0,63,25,1,64,19,1,64,20,4,64,21,6,64,22,4,64,23,4,64,25,4,65,10,4,65,17,6,65,19,0,65,20,0,65,21,0,65,22,0,65,23,1,65,25,0,66,18,4,66,23,0,67,10,0,68,13,6,68,18,0,68,24,0,71,24,1,72,12,6,72,13,1,72,24,0,73,12,1,74,14,1,75,12,6,75,17,4,76,12,1,76,15,1,76,17,0,77,10,4,77,12,4,77,17,4,78,17,0,79,10,0,79,13,6,80,10,4,82,10,0,82,14,6,83,14,1,84,13,4,84,16,6,85,10,4,85,13,6,86,14,6,87,16,4,88,10,0,88,16,0,90,16,4,91,14,1,92,16,0,93,10,4,93,12,1,93,15,6,94,12,6,95,9,4,95,12,4,95,13,1,96,12,6,96,13,6,97,9,0,99,15,4,100,15,6,101,13,1,101,15,4,102,14,6,103,9,4,103,14,1,104,9,0,104,11,6,104,14,6,104,15,0,105,9,4,106,9,0,106,12,1,108,9,4,111,11,1,111,15,4,112,10,6,112,15,0,113,10,4,117,10,6,121,9,6,122,9,4,123,8,4,125,11,6,126,8,0,127,8,4,127,11,1,128,14,1,131,8,0,132,15,4,133,15,0,134,10,4,134,15,4,135,15,6,136,15,1,137,14,6,137,16,4,138,16,6,139,14,1,139,16,1,139,17,4,140,9,0,140,11,6,140,15,6,141,14,4,141,15,4,141,17,1,142,18,4,143,11,4,143,14,6,143,16,6,143,18,1,143,19,4,144,14,1,144,15,1,144,16,4,144,19,0,144,26,1,145,10,0,145,12,6,145,16,1,145,19,1,145,20,6,145,25,1,145,27,1,146,12,4,146,20,1,146,21,1,146,24,4,147,22,1,147,23,1,147,24,1,147,26,7,148,13,6,148,28,1,148,29,4,149,16,7,149,19,7,149,20,7,149,21,7,149,25,2,149,26,0,149,27,2,149,28,7,149,29,7,150,14,4,150,15,4,150,16,4,150,17,4,150,18,4,150,19,4,150,20,4,150,21,4,150,22,4,150,23,7,150,25,0,150,27,7,151,13,4,151,14,1,151,17,1,151,18,0,151,19,0,151,21,0,151,22,0,151,23,4,151,27,1,151,28,4,151,29,4,152,11,0,152,14,0,152,15,1,152,17,0,152,19,4,152,20,0,152,23,0,152,26,2,152,27,2,152,28,0,153,12,0,153,14,4,153,15,0,153,19,0,153,27,0,153,29,0,154,13,0,154,16,0,154,24,7,154,25,2,154,26,7,155,14,0,155,24,2,155,25,0,155,26,1,156,23,2,156,26,2,157,23,0,157,25,2,158,13,4,158,23,2,158,25,1,158,26,0,159,23,0,159,24,7,159,25,0,160,10,4,160,22,7,160,23,1,160,24,1,161,13,0,161,20,4,161,21,1,161,22,1,161,23,0,161,24,0,162,10,0,162,19,4,162,20,1,162,22,0,162,25,4,163,17,1,163,19,1,163,21,0,164,16,7,164,17,4,164,18,1,164,20,0,165,6,7,165,15,4,165,16,4,165,19,0,165,25,0,166,15,0,166,17,1,167,6,0,167,14,4,167,16,7,167,18,0,168,13,4,168,15,1,168,16,1,168,17,0,171,14,1,171,16,0,172,12,4,172,16,4,172,18,4,172,19,1,173,16,1,173,18,1,173,20,1,174,13,1,174,16,6,174,21,1,174,22,7,174,23,4,175,16,1,175,17,4,175,24,4,175,25,4,176,8,7,176,11,4,177,8,0,177,12,1,177,17,1,177,19,7,177,20,7,177,21,7,177,23,1,179,24,7,179,26,4,180,24,4,181,20,0,181,24,7,182,10,4,182,11,7,182,20,4,182,26,0,183,11,1,183,19,1,183,20,0,184,20,7,185,7,7,185,23,7,185,24,4,186,11,7,187,7,0,187,8,7,187,9,7,187,20,1,187,21,1,187,23,1,187,24,7,188,12,4,188,22,1,189,10,7,189,11,1,189,12,1,189,13,7,190,9,4,190,10,1,190,12,7,190,22,7,190,23,7,191,11,7,191,13,1,191,21,7,192,10,7,192,12,4,192,22,0,192,24,2,192,25,0,193,21,1,193,22,7,193,23,1,194,8,4,194,10,1,194,11,1,194,21,2,194,22,2,194,24,0,195,8,7,195,9,7,195,10,7,195,11,4,195,13,7,195,21,0,195,22,0,196,8,4,197,13,1,197,23,0,199,8,0,199,12,0,199,21,7,200,8,4,200,9,1,200,10,0,200,11,0,200,12,4,200,21,2,200,24,2,201,8,0,201,9,7,201,21,0,201,24,1,202,8,7,202,9,0,202,12,7,202,13,7,202,16,7,202,17,7,203,14,7,203,15,7,203,16,4,203,17,4,203,21,7,204,10,7,204,15,4,204,18,7,204,21,1,204,24,0,205,10,0,205,18,4,206,17,7,206,23,2,207,9,1,207,16,0,207,17,0,207,19,4,207,23,0,207,25,1,208,8,0,208,9,7,208,13,4,208,14,0,208,15,0,208,18,0,208,22,7,208,25,2,209,9,0,209,13,0,209,14,7,209,19,0,209,20,4,210,13,4,210,14,0,210,18,4,210,21,7,210,22,1,210,25,0,211,7,2,211,13,0,211,18,0,211,21,4,211,22,4,211,26,2,212,7,0,212,20,0,212,26,1,213,7,7,213,12,0,213,21,0,213,26,2,214,22,0,214,26,0,214,27,2,215,8,2,216,7,0,216,8,0,216,24,7,216,25,2,216,27,1,216,28,2,217,24,0,217,25,7,217,26,2,217,27,2,218,24,2,218,25,2,218,29,2,219,24,7,219,28,1,220,24,0,220,25,0,220,28,2,221,11,7,221,26,0,222,25,2,222,27,0,222,29,1,222,30,2,223,6,2,223,22,2,223,23,2,223,25,0,223,28,0,223,29,2,224,22,0,224,23,0,224,30,7,225,6,0,227,29,0,229,29,7,229,30,1,230,30,7,231,27,2,231,30,4,232,27,0,232,28,7,232,29,0,232,30,0,235,27,7,235,28,0,236,3,7,236,4,2,236,11,2,238,2,2,238,3,2,238,4,0,238,27,0,239,3,0,239,11,7,239,26,7,240,11,2,240,15,2,240,17,2,240,26,1,240,28,2,241,11,7,241,26,0,241,28,0,241,29,7,241,30,7,242,2,0,242,13,2,242,15,0,242,16,2,242,17,0,242,28,1,242,29,1,242,30,1,243,11,2,243,13,0,243,15,2,243,18,2,243,25,2,243,27,1,243,28,0,243,29,0,243,30,0,244,11,7,244,16,7,244,18,7,244,25,7,244,27,0,245,13,2,245,15,0,245,17,7,245,19,7,245,24,7,245,26,7,246,11,2,246,15,7,246,20,7,246,26,1,247,13,0,247,17,2,247,18,2,247,21,2,247,26,0,248,11,0,248,15,2,248,16,2,248,19,2,248,20,2,248,22,2,248,23,2,248,25,1,249,14,2,249,16,0,249,17,0,249,20,7,249,21,7,249,22,7,249,23,7,249,24,1,249,25,0,250,14,0,250,15,0,250,16,2,250,17,7,250,18,7,250,24,7,251,16,0,251,17,0,251,18,0,251,19,7,251,24,1,252,18,2,252,23,1,252,24,0,254,22,1,255,18,0,255,19,0,255,23,0,1,17,7,1,19,7,2,10,2,2,17,0,2,18,7,2,21,1,2,22,0,3,9,2,3,10,0,3,18,0,4,9,0,4,18,7,4,19,1,5,20,1,5,21,0,6,13,2,6,14,7,6,19,7,7,13,0,7,14,0,7,17,4,7,20,0,8,12,7,8,18,1,8,19,1,9,12,0,9,17,7,10,17,1,11,16,4,11,19,0,12,16,7,13,14,4,13,16,1,14,10,2,14,14,0,14,16,7,14,18,0,15,10,0,15,15,4,16,16,1,18,14,4,18,17,0,21,15,1,22,11,4,22,12,4,22,16,0,23,11,7,23,12,0,23,15,6,24,15,1,25,13,4,25,15,0,26,8,7,26,14,6,27,8,0,27,11,0,27,12,4,30,11,4,30,13,6,30,14,0,31,7,2,32,7,7,34,12,6,34,13,1,36,8,7,36,13,0,37,8,0,38,6,2,38,10,4,39,6,7,39,7,0,40,6,2,40,11,6,40,12,1,41,9,4,42,9,0,42,12,0,43,7,7,44,6,7,44,7,0,44,9,4,45,9,0,46,9,4,46,11,1,47,5,2,49,10,6,49,11,0,51,6,2,52,6,0,53,8,4,53,10,1,56,10,0,58,5,7,59,5,2,59,9,6,60,9,1,64,8,1,65,8,4,67,4,7,67,9,4,68,5,0,68,9,1,69,4,0,69,9,0,70,4,7,71,4,2,71,8,1,73,7,4,75,4,7,76,4,2,77,6,7,79,4,7,80,4,2,83,4,7,84,4,2,85,7,7,87,6,0,89,4,0,90,7,1,92,6,7,96,6,0,97,7,7,103,7,4,103,9,4};
*/
// Fire
/*const uint16_t numpasos[] PROGMEM = {343};
const uint16_t angreducido[] PROGMEM = {806};
const uint16_t sizePolarRedu[] PROGMEM = {3261};
const uint8_t PolarRedu[3261] PROGMEM = {0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,0,6,0,0,7,0,0,8,0,0,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,2,0,20,2,0,21,5,0,22,2,0,23,2,0,24,2,0,25,2,0,26,0,0,27,2,0,28,2,0,29,0,0,30,2,1,21,2,1,26,2,1,30,0,2,19,0,2,26,0,2,27,0,2,28,0,3,25,5,3,29,2,4,19,2,4,23,0,4,25,2,4,26,2,4,29,0,4,30,2,5,23,2,5,30,0,6,19,0,6,23,0,6,24,0,6,27,2,6,29,2,7,20,5,7,23,2,7,24,2,7,28,2,7,29,0,8,20,2,8,23,5,8,27,0,8,29,2,9,23,2,9,25,0,9,26,0,9,27,2,9,29,0,9,30,2,10,24,0,10,26,2,10,29,2,11,24,2,11,25,2,11,27,0,11,29,0,12,23,0,12,24,0,12,25,0,12,26,0,12,28,0,12,30,0,13,18,2,13,24,2,13,25,2,13,26,2,14,18,0,14,22,0,14,26,0,15,19,2,15,22,2,15,24,0,16,20,5,16,22,0,17,19,0,17,22,2,18,22,0,18,25,0,19,19,2,19,22,2,19,23,2,20,19,0,21,19,2,21,20,2,22,19,0,22,20,5,23,20,2,23,23,0,26,20,5,27,19,2,28,19,0,28,20,2,28,22,0,29,22,2,30,19,2,31,19,0,31,23,2,32,19,2,32,24,2,33,20,5,33,24,0,34,20,2,34,23,0,36,23,2,36,27,2,37,19,5,37,24,2,37,26,2,38,19,2,38,23,0,39,23,2,39,25,2,39,27,0,39,28,2,40,19,0,40,27,2,41,19,2,41,24,0,41,26,0,41,28,0,42,19,0,42,24,2,42,27,0,42,28,2,43,19,2,43,20,5,43,21,5,43,25,0,43,28,0,44,20,2,44,21,2,44,24,0,44,29,2,45,18,2,45,22,5,45,24,2,45,29,0,46,19,5,47,18,5,47,20,5,47,22,2,48,21,0,49,18,2,49,20,2,49,21,2,50,18,0,50,19,2,50,21,5,50,22,5,51,20,5,51,21,2,51,22,2,51,24,0,51,26,2,52,21,5,52,25,2,52,26,0,52,28,2,53,19,0,53,20,2,53,21,2,53,27,2,54,20,5,54,21,5,54,24,2,54,26,2,55,20,2,55,29,2,56,20,5,56,29,0,57,22,5,57,28,0,57,29,2,59,20,2,59,23,5,59,29,0,60,20,5,60,24,5,60,25,0,60,28,2,61,25,2,61,26,0,61,28,0,61,30,2,62,21,2,62,22,2,62,23,2,62,24,2,62,26,2,62,27,0,62,29,2,62,30,0,63,19,2,63,21,5,63,27,2,63,29,0,64,19,0,64,20,2,64,21,2,64,29,2,64,30,2,65,25,5,65,28,2,65,29,0,65,30,0,66,25,2,66,28,0,67,24,0,68,20,5,68,24,2,69,23,0,70,23,2,70,26,0,71,23,0,71,27,0,72,20,2,72,21,5,72,23,2,72,25,0,73,22,5,73,23,0,73,24,0,74,21,2,74,23,2,75,21,5,76,20,0,76,21,2,77,21,0,77,22,2,77,24,2,78,20,2,78,21,2,78,25,2,79,23,0,79,24,0,80,22,5,80,24,2,81,22,2,81,24,0,81,25,0,82,20,0,82,23,2,82,24,2,83,20,2,83,21,5,83,26,2,84,23,0,84,26,0,85,22,5,85,24,0,85,25,2,86,21,2,86,22,2,86,23,2,86,30,2,87,21,5,87,22,5,87,24,2,87,30,0,88,20,0,88,21,2,88,22,2,88,23,5,88,25,5,88,26,2,88,29,2,88,30,2,89,21,5,89,22,5,89,23,2,89,24,5,89,25,2,89,27,2,89,28,2,90,20,2,90,21,2,90,22,2,90,23,5,90,24,2,92,21,5,92,22,5,92,23,2,92,30,0,93,22,2,93,30,2,94,22,5,94,23,5,94,25,5,94,26,5,94,27,5,95,22,2,95,25,2,95,26,2,95,27,2,95,30,0,96,22,5,96,23,2,96,26,5,97,26,0,97,29,0,98,20,0,98,25,0,98,27,5,99,21,2,99,26,2,99,27,2,100,22,2,100,24,0,100,26,0,100,27,0,100,28,0,101,19,2,101,21,5,101,22,5,102,18,2,102,20,2,102,22,2,102,24,2,103,18,0,103,19,0,103,20,0,103,21,2,103,22,5,103,25,2,104,21,5,105,26,2,106,22,2,106,23,5,106,27,2,107,21,2,107,23,2,107,28,2,108,22,5,109,21,5,109,23,5,109,26,0,109,28,0,110,21,2,110,23,2,110,28,2,111,27,0,111,28,0,112,22,2,112,24,0,112,25,0,113,24,2,113,25,2,114,23,5,114,25,0,115,23,2,117,22,0,118,22,2,119,25,2,119,26,2,119,27,2,119,28,2,119,29,2,120,19,2,120,20,2,120,21,5,120,22,5,120,27,0,120,28,0,120,29,0,120,30,2,121,19,0,121,20,0,121,26,0,121,27,2,121,28,2,122,22,2,122,29,2,123,21,2,123,24,0,123,30,0,124,24,2,124,26,2,124,29,0,125,21,5,125,22,5,125,28,0,125,30,2,126,22,2,126,29,2,126,30,0,128,20,2,128,28,2,128,30,2,129,20,0,129,21,2,129,27,0,129,29,0,129,30,0,130,21,5,130,22,5,130,26,0,130,27,2,130,28,0,131,22,2,131,26,2,131,29,2,132,22,5,133,20,2,133,28,2,133,29,0,134,20,0,134,25,0,134,27,0,134,29,2,135,23,5,135,29,0,136,21,2,136,26,0,136,28,0,137,20,2,137,21,5,137,23,2,137,27,2,138,20,0,138,22,2,138,23,5,138,25,2,138,27,0,139,23,2,139,25,0,140,25,2,141,22,5,141,24,0,142,22,2,142,24,2,143,20,2,143,25,0,144,20,0,144,22,5,144,23,5,144,27,2,145,23,2,145,26,2,145,27,0,145,30,2,146,29,2,146,30,0,147,25,2,147,26,0,147,27,2,147,28,2,148,26,2,149,23,5,150,20,2,150,29,0,151,20,0,151,21,2,151,22,2,151,24,5,152,20,2,152,22,5,152,23,2,152,24,2,152,28,0,153,22,2,154,24,5,155,20,0,155,24,2,155,30,2,156,20,2,156,21,0,156,28,2,156,29,2,156,30,0,157,25,5,157,30,2,158,20,5,158,21,2,158,25,2,159,20,2,159,23,5,159,29,0,159,30,0,160,24,5,161,23,2,161,24,2,161,27,0,162,21,5,162,26,0,162,28,0,162,29,2,163,23,0,163,25,0,163,26,2,163,29,0,165,22,5,165,23,2,165,24,0,166,22,2,166,23,0,166,26,0,167,22,5,167,25,2,168,21,2,168,22,2,168,24,2,169,23,2,169,26,2,170,22,5,171,21,5,171,22,2,172,21,2,172,23,5,172,26,0,173,23,2,174,20,5,175,20,2,175,26,2,175,30,2,177,28,2,178,19,2,178,22,5,178,24,0,178,27,2,178,29,2,179,24,2,179,26,0,179,30,0,180,19,5,180,21,5,180,26,2,180,27,0,181,29,0,181,30,2,182,18,2,182,19,2,182,20,5,182,22,2,182,27,2,182,29,2,182,30,0,183,23,5,183,24,5,183,25,5,183,30,2,184,21,2,184,23,2,184,24,2,184,25,2,184,28,0,185,18,0,185,22,5,185,28,2,185,29,0,186,19,0,186,22,2,186,27,0,186,28,0,186,30,0,187,26,0,188,20,2,188,21,5,188,30,2,189,19,2,189,20,5,189,26,2,190,23,5,190,27,2,190,28,2,191,19,0,191,30,0,192,19,2,192,23,2,192,24,5,192,25,5,192,27,0,192,28,0,193,19,0,193,23,5,193,25,0,193,29,2,194,20,2,194,23,2,194,24,2,194,25,2,195,21,2,195,25,0,196,20,5,196,26,0,196,29,0,197,22,5,198,19,2,198,22,2,198,24,0,198,26,2,199,25,2,199,26,0,199,29,2,200,20,2,200,21,5,200,29,0,201,19,5,201,21,2,201,24,2,201,25,0,201,26,2,202,22,5,202,24,0,202,26,0,202,27,2,202,28,2,203,19,2,203,22,2,203,23,5,203,24,2,203,25,2,203,27,0,203,28,0,204,23,2,204,27,2,204,28,2,205,27,0,206,19,0,206,28,0,207,19,2,207,20,5,207,22,5,207,26,2,208,19,0,208,22,2,208,24,0,208,27,2,209,20,2,209,24,2,209,28,2,210,21,5,210,26,0,211,19,2,211,22,5,211,24,0,211,25,0,211,26,2,211,29,2,211,30,2,212,19,0,212,21,2,212,22,2,212,23,0,212,24,2,212,25,2,212,27,0,212,30,0,213,19,2,213,21,5,213,25,0,213,26,0,213,27,2,213,28,0,214,19,0,214,21,2,214,23,2,214,25,2,214,26,2,214,27,0,214,29,0,215,21,5,215,22,5,215,25,0,215,26,0,216,19,2,216,20,5,216,22,2,217,18,2,218,18,0,218,19,5,218,24,0,219,19,2,219,20,2,220,19,0,220,23,0,221,19,2,221,20,5,221,21,2,221,22,0,221,23,2,222,20,2,222,22,2,223,21,5,224,20,5,224,27,2,224,28,2,225,21,2,225,28,0,226,21,5,226,24,2,226,27,0,226,28,2,227,21,2,227,22,5,227,25,2,227,27,2,227,29,2,228,19,5,228,21,5,228,22,2,228,23,5,228,26,2,229,19,2,229,23,2,229,30,2,230,20,2,230,21,2,230,22,5,231,19,5,231,20,5,231,21,5,231,22,2,231,23,5,231,26,5,232,21,2,232,24,5,232,26,2,232,29,0,233,24,2,233,29,2,234,23,2,234,24,5,234,28,0,234,29,0,234,30,0,235,24,2,235,25,5,236,18,2,236,21,5,236,24,0,236,25,2,237,17,2,237,18,0,237,20,2,237,21,2,237,24,2,238,17,0,238,23,0,238,25,0,238,26,0,238,28,2,239,20,5,239,23,2,239,24,0,239,26,2,239,28,0,240,19,2,240,21,5,240,25,2,240,26,0,241,21,2,241,24,2,241,26,2,242,19,5,243,18,2,243,23,0,243,24,0,243,25,0,244,17,2,245,17,0,245,26,0,245,27,0,246,18,0,246,21,5,246,23,2,247,18,2,247,19,2,248,19,5,248,20,2,248,24,2,249,21,0,250,19,2,250,26,2,251,18,0,251,19,5,251,20,5,251,24,0,251,26,0,252,21,5,253,18,2,253,24,2,253,25,2,254,19,2,254,21,2,254,25,0,255,20,2,255,21,5,255,27,2,1,20,5,1,21,2,1,24,0,1,25,2,1,26,2,2,24,2,3,16,2,3,19,5,3,21,5,4,19,2,4,26,0,5,16,0,5,19,5,5,27,0,6,21,2,8,19,2,8,20,2,8,22,5,8,24,0,8,26,2,9,22,2,9,26,0,10,19,5,10,24,2,10,27,2,11,19,2,11,26,2,12,27,0,13,22,0,13,23,0,14,26,0,15,19,5,17,21,0,17,24,0,17,25,0,18,21,2,18,22,2,18,23,2,19,23,0,19,26,2,20,18,5,21,22,0,21,28,2,22,18,2,22,19,2,22,24,2,23,18,0,23,20,5,23,23,2,23,25,2,23,26,0,23,28,0,24,19,5,24,22,2,24,25,0,25,18,2,25,19,2,25,20,2,25,22,0,25,25,2,26,19,5,27,18,5,27,22,2,28,18,2,28,19,2,28,22,0,28,27,2,29,19,5,29,22,2,29,26,2,30,18,5,30,28,2,31,20,5,31,28,0,31,29,2,32,19,2,32,27,0,32,29,0,33,20,2,33,27,2,33,28,2,33,29,2,33,30,2,34,18,2,34,28,0,34,29,0,34,30,0,35,18,5,35,19,5,35,28,2,35,29,2,35,30,2,36,18,0,36,28,0,36,29,0,36,30,0,37,18,2,37,28,2,38,19,2,38,28,0,39,18,0,39,19,5,39,26,0,40,18,2,40,21,0,40,23,0,41,22,0,41,25,0,41,27,0,42,19,2,42,22,2,42,24,0,42,25,2,43,18,0,43,19,5,43,25,0,44,19,2,44,20,0,44,25,2,45,21,2,45,23,2,45,25,0,46,18,2,46,20,2,46,23,0,47,19,5,47,22,0,47,26,2,47,28,2,48,20,5,48,22,2,48,26,0,48,28,0,48,29,2,49,20,2,49,24,2,49,25,2,50,23,2,50,25,0,50,29,0,51,20,5,51,23,0,51,26,2,52,21,5,52,23,2,52,25,2,53,21,2,53,24,0,53,25,0,53,26,0,54,24,2,54,25,2,54,26,2,54,30,2,55,20,2,55,26,0,55,27,2,55,29,2,55,30,0,56,20,5,56,21,5,56,26,2,56,30,2,57,28,2,59,18,0,59,21,2,59,30,0,60,18,2,60,19,2,60,21,5,61,18,0,61,19,5,61,20,2,61,29,0,62,18,2,62,21,2,63,27,0,63,28,0,64,19,2,64,26,0,66,21,0,66,24,0,68,18,5,68,21,2,68,25,0,69,18,2,69,19,5,69,20,0,70,18,0,70,19,2,70,20,2,70,22,0,71,18,2,71,19,5,72,22,2,72,23,0,73,19,2,73,22,0,74,18,0,74,19,5,75,18,2,75,20,5,75,21,5,76,19,2,76,21,2,77,19,5,77,20,2,78,19,2,79,18,0,79,20,0,79,22,2,80,18,2,80,19,5,80,24,2,80,25,2,80,26,2,81,18,0,81,26,0,82,18,2,82,19,2,82,20,2,82,21,0,82,23,2,82,26,2,83,20,0,83,21,2,84,18,0,84,20,2,84,25,0,85,18,2,85,26,0,85,30,2,86,18,0,86,25,2,88,19,5,88,25,0,88,26,2,88,27,2,89,24,0,89,25,2,89,30,0,90,20,0,90,24,2,90,28,2,90,29,2,91,19,2,91,20,5,91,21,0,91,22,0,91,25,0,91,26,0,91,27,0,91,29,0,92,20,2,92,21,2,92,22,2,92,23,0,92,24,0,92,28,0,93,21,0,93,22,0,93,24,2,94,24,0,96,21,2,98,20,0,99,22,2,99,26,2,100,20,2,100,25,2,101,19,5,101,22,0,101,23,2,102,19,2,102,25,0,102,27,2,103,21,5,103,22,2,103,26,0,103,28,2,104,24,2,104,25,2};
*/
// Child
/*const uint16_t numpasos[] PROGMEM = {329};
const uint16_t angreducido[] PROGMEM = {741};
const uint16_t sizePolarRedu[] PROGMEM = {2826};
const uint8_t PolarRedu[2826] PROGMEM = {0,1,1,0,2,1,0,3,1,0,4,1,0,5,1,0,6,1,0,7,1,0,8,1,0,9,1,0,10,1,0,11,1,0,12,1,0,13,1,0,14,1,0,15,1,0,16,1,0,17,1,0,18,1,0,19,2,0,20,2,0,21,2,0,22,0,0,23,0,0,24,2,0,25,1,0,26,2,0,27,0,0,28,0,0,29,0,0,30,0,1,25,5,1,26,5,2,20,0,2,25,2,2,26,1,3,18,5,3,21,0,4,18,2,4,26,5,4,27,2,5,19,0,5,25,5,5,26,2,6,27,5,8,24,0,8,27,1,9,24,2,9,25,2,9,26,1,9,27,2,10,18,0,10,26,5,11,27,5,12,17,5,12,25,5,12,28,2,13,17,2,13,26,2,13,28,5,14,17,5,14,25,2,14,27,2,15,26,5,16,17,2,18,23,2,18,25,5,18,27,5,18,28,2,18,29,2,19,9,5,19,26,2,19,27,2,19,29,5,20,25,1,20,29,1,21,6,5,21,7,5,21,8,5,21,10,5,21,26,5,22,4,5,22,5,5,22,25,5,22,26,2,22,29,2,23,25,1,23,30,2,24,11,5,24,26,5,24,28,0,24,30,0,25,27,0,25,29,0,25,30,2,26,18,2,26,23,0,26,30,5,27,23,2,27,25,5,27,30,2,28,12,5,28,23,0,28,26,1,29,27,2,29,30,0,30,10,2,30,11,2,30,13,5,30,19,2,30,25,2,31,17,5,31,26,5,31,27,0,32,9,2,32,24,0,32,27,2,33,17,1,33,27,5,34,8,2,34,12,2,34,26,2,35,13,2,35,23,2,35,27,1,36,6,2,36,7,2,36,14,5,36,20,2,36,24,2,36,27,5,37,3,5,38,18,5,38,28,2,39,5,2,39,24,5,39,27,2,40,21,2,40,24,1,40,25,1,41,18,1,42,15,5,42,22,2,43,19,5,43,26,5,43,28,0,44,16,5,44,26,1,44,27,5,45,3,1,45,14,2,46,3,5,46,17,5,46,19,1,46,20,5,47,18,5,48,19,5,48,23,5,48,24,5,49,15,2,49,21,5,49,24,1,49,27,1,51,28,2,52,4,2,52,16,2,52,22,5,53,28,1,54,17,2,54,18,2,54,21,2,55,19,2,55,20,2,55,22,2,55,23,2,56,29,2,57,24,5,57,29,5,58,24,2,58,29,2,59,29,5,60,25,2,60,29,1,61,3,1,64,30,5,65,26,5,65,30,2,66,10,5,66,26,2,68,9,5,68,10,1,68,30,1,69,3,5,69,9,2,69,11,1,69,12,5,69,16,5,70,8,0,70,9,0,70,10,0,70,11,2,70,27,2,71,12,1,71,13,5,71,15,5,71,27,5,72,11,0,72,12,2,72,13,1,72,14,5,72,27,2,73,14,1,74,12,0,74,13,2,74,17,5,75,3,1,75,13,0,75,14,5,76,7,0,76,14,0,76,15,2,76,30,5,77,17,2,78,16,2,78,17,5,78,28,5,78,30,2,79,15,0,79,17,2,80,8,1,81,9,1,81,13,1,81,28,2,81,30,0,82,14,2,82,16,0,82,28,5,83,14,1,83,17,0,83,28,2,84,7,2,84,13,0,84,17,2,85,9,0,85,15,2,86,7,0,86,15,1,86,29,5,87,29,2,88,14,5,88,17,0,89,5,5,89,8,0,89,16,2,89,29,0,90,14,0,90,17,2,91,5,2,91,8,1,92,5,5,92,8,0,92,16,5,93,13,2,93,16,2,94,14,2,94,17,5,94,18,5,94,26,5,94,28,0,95,13,0,95,14,5,95,17,1,95,18,1,96,13,1,96,14,2,96,16,5,96,25,5,97,13,5,97,16,1,97,26,2,98,4,5,98,13,2,98,18,5,98,25,2,99,12,2,99,14,1,99,26,5,100,5,1,100,11,2,100,13,1,100,17,5,100,26,2,100,27,0,101,10,2,101,12,1,101,17,1,101,25,5,102,4,1,102,9,1,102,11,1,102,27,5,102,28,1,102,29,2,103,10,1,103,19,5,103,25,2,103,26,5,103,27,2,103,28,2,103,30,1,104,8,1,104,25,1,104,26,2,104,30,5,105,6,1,105,7,1,105,20,5,105,21,5,105,25,2,105,30,2,106,17,5,106,19,2,106,25,5,107,16,5,107,17,2,107,18,2,107,20,2,107,21,2,107,22,1,107,23,1,107,25,2,108,15,5,109,15,1,109,16,2,109,22,2,109,24,5,110,15,5,110,23,5,111,23,2,111,24,1,112,24,5,114,24,2,115,30,5,116,30,2,117,4,5,117,30,0,120,5,5,120,29,0,121,28,0,123,4,2,123,6,5,123,27,0,124,26,0,125,5,2,125,24,0,125,25,0,126,6,2,126,7,5,127,3,5,127,23,0,129,4,5,129,5,5,130,7,2,130,16,5,130,27,5,130,28,1,130,29,1,130,30,1,131,8,5,131,26,1,131,27,1,132,22,0,132,24,1,132,25,1,132,28,6,132,29,6,132,30,6,133,8,1,133,23,1,133,26,6,134,5,2,134,22,1,134,25,6,134,27,6,135,8,5,135,23,6,135,24,6,135,30,4,136,4,1,136,8,1,136,10,5,136,11,5,136,21,1,136,22,6,136,25,4,136,26,4,136,27,4,136,28,4,136,29,0,136,30,0,137,5,5,137,15,1,137,23,4,137,24,0,137,25,0,137,26,0,137,27,0,137,28,0,138,10,2,138,11,2,138,12,5,138,15,5,138,21,4,138,22,0,138,23,0,139,5,2,139,9,5,139,21,0,140,15,1,141,7,5,141,12,2,141,15,5,142,4,5,142,9,2,142,12,5,142,20,0,143,12,2,144,8,5,144,12,5,145,12,2,145,16,2,145,30,2,146,7,1,146,13,5,146,30,0,147,10,0,147,14,5,148,8,2,149,19,0,150,14,2,150,15,2,150,19,2,150,29,6,151,7,5,151,13,2,152,30,6,153,6,5,153,30,2,154,9,0,154,30,3,155,6,1,155,20,2,155,30,5,156,20,0,156,30,2,157,22,2,157,29,4,157,30,5,158,26,2,158,29,0,158,30,2,159,20,2,159,22,0,159,26,0,160,25,1,160,29,2,161,4,2,162,25,2,162,27,2,163,7,1,163,26,2,163,28,2,164,7,5,164,27,0,165,8,0,165,26,0,165,27,4,165,28,0,165,29,0,165,30,0,166,25,0,166,27,0,168,7,1,168,20,0,168,25,4,169,4,5,169,14,5,169,29,2,169,30,5,170,13,5,170,24,6,170,25,0,170,28,2,170,29,5,171,24,0,171,28,5,172,10,2,172,27,2,173,4,2,173,14,1,173,23,1,174,26,2,174,27,5,175,11,5,175,22,2,176,19,0,176,22,1,176,24,2,176,25,2,177,11,2,177,23,0,177,24,0,177,30,2,178,18,0,178,22,6,178,23,3,178,24,5,178,25,5,178,29,2,179,15,5,179,23,6,179,24,2,179,26,5,179,28,2,180,13,1,180,21,6,180,24,0,180,25,0,180,27,2,181,29,0,181,30,0,182,21,1,182,23,1,182,26,2,182,28,0,183,12,5,183,22,1,183,25,2,183,27,0,183,28,1,183,29,6,183,30,6,184,11,1,184,23,6,184,26,0,184,27,1,185,13,5,185,21,6,185,25,0,185,26,5,185,27,6,185,28,6,186,15,1,186,25,1,186,26,1,186,27,1,186,28,1,186,29,1,186,30,5,187,16,5,187,29,5,187,30,2,188,4,5,188,13,1,188,21,1,188,22,6,188,23,1,188,26,6,188,28,2,189,20,1,189,25,6,189,26,1,189,27,5,189,28,5,189,30,5,190,3,1,190,21,6,190,25,1,191,20,6,191,22,1,191,25,5,191,26,5,192,4,2,192,20,1,193,20,6,193,22,6,193,23,6,193,25,2,194,5,5,194,12,1,194,25,5,196,25,2,197,4,5,197,30,2,198,16,1,198,23,1,198,24,2,198,25,5,199,10,0,199,22,1,199,23,6,199,24,1,199,30,5,200,24,3,201,24,6,201,25,2,202,5,2,203,8,5,203,24,1,204,17,5,204,22,6,205,22,1,205,25,0,206,8,1,206,18,2,208,16,5,208,23,1,208,25,2,209,18,0,209,24,6,210,17,2,210,24,1,210,25,5,211,4,1,211,18,2,211,25,1,212,9,1,213,6,2,213,20,0,214,15,5,215,16,2,215,19,2,215,26,2,216,14,5,216,21,1,217,13,5,217,14,2,217,15,2,217,21,6,217,26,1,217,30,2,218,6,5,218,11,5,218,12,5,218,13,2,218,19,5,219,12,2,219,19,2,219,27,1,219,30,5,220,10,1,220,11,2,220,27,2,221,27,5,222,5,5,222,20,2,222,21,1,222,27,1,222,28,1,223,20,5,223,21,6,224,5,1,224,6,1,224,29,1,225,10,5,225,20,2,225,30,1,226,21,1,228,21,5,228,30,5,229,30,1,230,21,2,232,25,2,233,22,5,233,24,0,233,25,0,234,22,2,234,23,0,234,26,0,234,27,0,235,10,1,235,11,5,235,19,5,235,22,5,235,27,2,235,28,0,235,29,5,235,30,0,236,18,5,236,20,5,236,23,5,236,27,0,236,29,0,237,10,5,237,21,5,237,22,2,238,10,1,238,12,5,238,17,5,238,22,5,239,13,5,239,16,5,240,14,5,240,15,5,240,24,2,241,11,1,242,12,1,242,23,1,242,24,0,242,25,2,242,26,2,243,13,1,243,14,1,243,15,1,243,18,1,243,19,1,243,22,1,243,23,5,243,24,1,244,16,1,244,17,1,244,21,1,244,23,1,244,25,5,245,20,1,245,26,5,245,27,2,245,29,2,246,25,1,246,26,1,246,27,1,246,28,2,246,29,0,247,28,1,247,29,2,248,29,5,249,30,2,250,29,1,250,30,0,252,30,1,254,25,2,254,26,5,2,8,2,2,25,5,3,7,2,3,25,1,3,26,1,3,29,5,4,6,5,4,9,2,4,30,5,5,8,0,5,10,2,5,26,5,5,28,5,6,7,0,6,9,0,6,11,2,6,26,1,6,27,5,6,28,2,7,10,0,7,12,2,7,27,1,7,29,2,7,30,1,8,6,1,8,11,0,8,12,0,8,13,2,8,28,1,8,29,5,8,30,0,9,13,5,9,29,1,10,13,0,10,14,2,11,13,1,11,14,1,11,26,2,11,28,0,11,29,2,12,13,2,12,26,0,12,27,0,12,29,0,13,13,0,14,6,0,14,26,2,15,6,1,15,26,5,17,6,0,17,16,5,17,26,1,18,11,1,18,12,1,18,13,1,18,16,2,19,11,0,19,15,2,20,11,1,20,13,2,21,13,1,22,14,5,22,15,0,23,6,2,23,17,5,24,12,0,24,14,2,24,17,1,24,27,2,25,11,0,25,13,2,26,12,2,26,13,0,26,14,0,27,6,0,27,15,2,28,11,2,28,16,5,28,27,5,29,12,0,30,6,2,30,11,0,30,14,2,30,16,1,30,27,2,31,27,1,32,13,2,33,7,1,33,15,5,34,15,1,35,12,1,36,6,1,36,7,2,37,11,1,37,14,5,39,7,5,39,12,2,39,17,5,40,7,1,40,9,1,40,10,1,40,13,5,40,14,1,40,16,5,41,8,1,41,11,2,41,17,1,42,12,5,43,13,1,43,27,2,44,10,2,44,27,1,45,11,5,45,15,5,45,27,5,46,10,5,46,16,1,46,27,2,47,9,5,47,13,5,47,14,5,47,27,0,49,27,2,50,9,1,50,27,0,51,15,1,52,10,1,54,13,2,54,26,5,55,26,2,56,14,1,59,13,5,61,25,5,62,12,2,62,26,0,63,12,5,64,13,1,64,25,2,65,13,5,66,13,1,66,24,5,67,25,0,68,24,1,69,24,5,70,24,1,71,24,5,72,12,1,72,23,5,72,24,1,73,23,1,74,24,5,75,23,5,75,24,1,77,23,1,77,24,5,78,23,5,79,23,1,79,24,2,80,24,5,81,11,1,81,24,2,83,23,5,83,24,5,84,22,5,84,24,1,85,24,2,86,23,1,86,24,1,87,23,5,87,24,5,88,23,1,88,24,1,89,24,5,92,23,5,92,24,1,93,21,5,93,23,1,94,21,2,94,22,2,95,25,2,96,25,0,97,20,5,98,22,5,98,25,2,99,20,2,99,22,2,99,24,5,99,25,5,100,23,5,100,24,1,100,25,1,101,23,2,101,25,5,102,19,5,102,25,1,103,19,2,103,22,0,103,23,0,103,24,5,103,26,2,104,24,2};
*/
// Ball
/*const uint16_t numpasos[] PROGMEM = {101};
const uint16_t angreducido[] PROGMEM = {999};
const uint16_t sizePolarRedu[] PROGMEM = {954};
const uint8_t PolarRedu[954] PROGMEM = {0,1,0,0,2,0,0,3,0,0,4,0,0,5,0,0,6,0,0,7,0,0,8,0,0,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,0,0,20,0,0,21,0,0,22,0,0,23,0,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,117,9,6,117,10,6,118,11,6,118,12,6,119,8,6,120,7,6,120,9,1,120,10,1,120,11,1,120,13,6,121,8,1,121,12,1,121,14,6,122,6,6,122,13,1,123,7,1,123,10,0,123,13,0,123,15,6,124,5,6,124,8,0,124,11,0,124,12,0,124,14,0,124,15,0,124,16,6,125,9,0,125,17,6,126,6,1,126,7,0,126,16,0,127,17,0,128,6,0,128,10,1,128,11,1,128,12,1,128,13,1,128,18,6,129,14,1,129,15,1,129,16,1,129,17,1,130,8,1,130,9,1,130,18,1,130,19,6,132,19,1,132,20,6,133,7,1,134,5,0,134,6,1,134,13,0,134,14,0,134,15,0,134,16,0,134,17,0,134,18,0,134,20,1,134,21,6,135,4,6,135,11,0,135,12,0,135,19,0,136,10,0,136,20,0,136,21,0,137,5,1,137,22,6,138,9,0,139,22,0,140,8,0,140,15,1,140,16,1,140,17,1,140,18,1,140,19,1,140,20,1,140,21,1,140,23,6,141,7,0,141,22,1,142,13,1,142,14,1,142,23,1,143,6,0,143,24,6,144,12,1,145,11,1,145,24,1,146,19,0,146,20,0,146,21,0,146,22,0,146,23,0,146,25,6,147,5,0,147,10,1,147,18,0,147,24,0,148,17,0,148,25,0,149,9,1,149,16,0,150,4,1,150,14,0,150,15,0,151,24,1,151,26,6,152,8,1,152,21,1,152,22,1,152,23,1,152,25,1,153,13,0,153,19,1,153,20,1,154,4,0,154,12,0,154,26,1,155,18,1,156,7,1,156,11,0,156,17,1,156,27,6,157,16,1,157,23,0,157,24,0,157,25,0,157,26,0,158,22,0,159,3,6,159,15,1,159,21,0,160,6,1,160,10,0,160,20,0,160,27,0,162,9,0,162,14,1,162,19,0,162,25,1,162,26,1,162,27,1,162,28,6,163,5,1,163,18,0,163,24,1,163,28,0,164,13,1,164,22,1,164,23,1,164,28,6,165,3,0,165,17,0,166,12,1,166,21,1,166,26,0,166,27,0,167,8,0,167,16,0,167,25,0,168,20,1,168,24,0,170,23,0,171,11,1,171,15,0,171,19,1,171,26,1,171,27,1,172,22,0,172,27,0,173,4,1,173,25,1,174,7,0,174,14,0,174,18,1,175,21,0,175,24,1,175,26,0,176,10,1,176,17,1,177,13,0,177,20,0,178,23,1,178,25,0,179,28,0,180,16,1,180,22,1,182,19,0,182,24,0,183,12,0,183,26,1,183,27,6,184,9,1,184,26,0,185,6,0,185,15,1,185,18,0,185,21,1,185,23,0,185,25,1,186,25,0,186,27,0,188,26,6,189,20,1,189,25,1,189,26,0,190,5,0,190,11,0,190,22,0,190,24,1,190,25,0,190,26,6,191,8,1,191,14,1,191,17,0,192,26,0,194,19,1,194,23,1,194,24,0,194,25,6,195,21,0,195,25,0,197,4,6,197,13,1,197,16,0,198,22,1,198,23,0,198,24,6,199,10,0,199,18,1,199,20,0,199,24,0,200,23,6,201,7,1,203,15,0,203,22,6,203,23,0,205,17,1,205,21,1,206,12,1,206,21,6,206,22,0,207,4,0,207,19,0,208,5,6,208,6,1,208,9,0,208,20,6,208,21,0,209,14,0,210,20,0,211,18,0,211,19,6,212,16,1,212,19,0,213,18,6,214,8,0,214,11,1,214,17,6,214,18,0,215,5,0,216,6,6,216,15,1,216,16,6,217,13,0,217,15,6,217,17,0,218,10,1,218,16,0,219,14,6,220,7,6,220,12,6,220,15,0,221,8,6,221,11,6,221,13,6,221,14,0,222,9,6,222,13,0,223,6,0,223,10,6,224,7,0,224,12,0,225,8,0,225,9,0,225,10,0,225,11,0};
*/
// Illusion
/*const uint16_t numpasos[] PROGMEM = {354};
const uint16_t angreducido[] PROGMEM = {1164};
const uint16_t sizePolarRedu[] PROGMEM = {4713};
const uint8_t PolarRedu[4713] PROGMEM = {0,1,0,0,2,1,0,3,1,0,4,0,0,5,0,0,6,1,0,7,1,0,8,0,0,9,0,0,10,1,0,11,0,0,12,1,0,13,0,0,14,1,0,15,1,0,16,1,0,17,1,0,18,1,0,19,1,0,20,1,0,21,0,0,22,0,0,23,1,0,24,1,0,25,0,0,26,0,0,27,1,0,28,1,0,29,1,0,30,1,1,12,0,1,21,1,2,5,1,2,7,0,2,23,0,2,24,0,2,26,1,3,13,1,3,16,0,3,17,0,3,18,0,3,22,1,3,25,1,3,29,0,3,30,0,4,3,0,4,9,1,4,12,1,4,14,0,4,15,0,4,19,0,4,27,0,4,28,0,5,2,0,5,6,0,5,10,0,5,12,0,5,20,0,5,21,0,5,24,1,5,26,0,6,8,1,6,11,1,6,12,1,6,13,0,6,15,1,6,16,1,6,18,1,6,25,0,6,29,1,6,30,1,7,17,1,7,19,1,7,24,0,7,27,1,7,28,1,8,4,1,8,9,0,8,12,0,8,13,1,8,14,1,8,20,1,8,22,0,8,23,1,8,26,1,9,25,1,10,1,1,10,3,1,10,5,0,10,7,1,10,11,0,10,15,0,10,17,0,10,18,0,10,21,1,10,23,0,10,24,1,10,30,0,11,8,0,11,10,1,11,12,1,11,14,0,11,16,0,11,27,0,11,28,0,11,29,0,12,4,0,12,19,0,12,23,1,12,25,0,12,26,0,13,13,0,13,20,0,13,29,1,13,30,1,14,9,1,14,12,0,14,15,1,14,16,1,14,17,1,14,24,0,14,27,1,14,28,1,15,2,1,15,6,1,15,7,0,15,10,0,15,14,1,15,18,1,15,22,1,15,23,0,15,25,1,15,26,1,16,3,0,16,13,1,17,12,1,17,19,1,17,22,0,17,23,1,17,24,1,18,5,1,18,6,0,18,8,1,18,29,0,18,30,0,19,9,0,19,10,1,19,13,0,19,14,0,19,15,0,19,16,0,19,17,0,19,21,0,19,22,1,19,26,0,19,27,0,19,28,0,20,12,0,20,25,0,21,10,0,21,11,1,21,18,0,21,21,1,21,24,0,22,4,1,22,5,0,22,11,0,22,23,0,22,26,1,22,27,1,22,28,1,22,29,1,22,30,1,23,3,1,23,8,0,23,14,1,23,15,1,23,22,0,23,24,1,23,25,1,24,7,1,24,12,1,24,13,1,24,16,1,24,20,1,24,21,0,24,23,1,25,2,0,25,9,1,25,10,1,26,2,1,26,10,0,26,11,1,26,17,1,26,20,0,26,22,1,27,4,0,27,7,0,27,21,1,28,6,1,28,9,0,28,13,0,28,20,1,28,25,0,28,26,0,28,27,0,28,28,0,29,10,1,29,12,0,29,14,0,29,19,0,29,23,0,29,24,0,29,29,0,30,1,0,30,3,0,30,9,1,30,11,0,30,15,0,30,22,0,30,30,0,31,8,1,31,19,1,31,21,0,32,6,0,32,9,0,33,10,0,33,13,1,33,18,1,33,20,0,33,24,1,33,25,1,33,27,1,34,5,1,34,8,0,34,12,1,34,14,1,34,16,0,34,22,1,34,23,1,34,26,1,34,28,1,35,1,1,35,9,1,35,11,1,35,19,0,35,21,1,35,29,1,36,2,0,36,7,1,36,20,1,37,8,1,37,9,0,37,17,0,37,18,0,38,4,1,38,10,1,38,17,1,38,19,1,38,30,1,39,5,0,39,17,0,39,18,1,40,7,0,40,9,1,40,15,1,41,8,0,41,11,0,41,15,0,41,16,1,42,12,0,42,16,0,42,17,1,43,10,0,43,15,1,44,6,1,44,15,0,45,4,0,45,13,0,45,15,1,45,16,1,45,21,0,45,22,0,45,23,0,45,30,0,46,3,1,46,8,1,46,9,0,46,15,0,46,19,0,46,20,0,46,24,0,47,7,1,47,25,0,48,2,1,48,6,0,48,10,1,48,18,0,49,5,1,50,8,0,50,11,1,50,17,0,50,26,0,51,7,0,51,12,1,51,15,1,51,29,0,51,30,1,52,9,1,52,21,1,52,22,1,53,16,0,53,19,1,53,20,1,53,29,1,54,23,1,55,18,1,55,30,0,56,1,0,56,3,0,56,17,1,56,28,0,57,5,0,57,15,0,57,24,1,57,28,1,57,29,0,58,6,1,58,7,1,58,8,1,59,16,1,60,4,1,60,10,0,60,28,0,60,30,1,61,1,1,61,7,0,61,9,0,62,8,0,62,14,0,62,15,1,62,25,1,63,11,0,63,25,0,63,29,1,64,19,0,64,25,1,64,27,0,65,6,0,65,18,0,65,20,0,66,2,0,66,7,1,66,14,1,66,17,0,66,21,0,66,28,1,67,13,1,67,16,0,68,13,0,68,22,0,68,30,0,69,3,1,69,27,1,70,9,1,70,10,1,71,4,0,71,15,0,71,29,0,72,5,1,73,6,1,73,8,1,73,26,1,73,28,0,74,7,0,74,12,0,74,17,1,74,18,1,74,19,1,74,23,0,75,25,0,75,27,0,76,12,1,76,14,0,76,20,1,76,25,1,77,12,0,77,13,1,77,16,1,77,21,1,78,7,1,78,11,1,78,25,0,79,15,1,80,25,1,81,1,0,81,22,1,81,24,0,81,26,0,82,28,1,83,9,0,84,13,0,85,5,0,85,8,0,85,14,1,85,27,1,86,10,0,87,3,0,87,23,1,89,17,0,89,18,0,90,19,0,90,25,0,91,1,1,91,3,1,92,16,0,92,20,0,93,26,1,94,3,0,94,11,0,94,12,1,94,13,1,94,15,0,95,13,0,95,21,0,95,24,1,97,7,0,97,28,0,98,6,0,98,9,1,98,22,0,99,8,1,99,10,1,100,1,0,100,13,1,100,18,1,101,14,0,101,17,1,101,19,1,102,4,1,102,20,1,102,23,0,102,27,0,103,16,1,103,25,1,104,12,0,104,13,0,104,21,1,105,2,1,105,11,1,106,24,0,107,22,1,107,29,1,108,6,1,108,15,1,109,13,1,109,23,1,109,25,0,110,12,1,111,6,0,111,9,0,111,10,0,111,30,1,112,24,1,113,13,0,114,7,1,114,11,0,114,26,0,115,2,0,115,7,0,115,20,0,115,25,1,116,2,1,116,6,1,116,8,0,116,17,0,116,18,0,116,19,0,116,21,0,117,4,0,117,13,1,118,6,0,118,12,0,118,22,0,118,26,1,118,27,1,119,23,0,119,27,0,120,7,1,120,24,0,121,4,1,121,10,1,122,9,1,122,11,1,122,16,0,122,27,1,123,4,0,123,6,1,123,7,0,123,13,0,123,25,0,124,14,1,124,19,1,124,20,1,124,21,1,124,22,1,124,29,0,125,1,1,125,7,1,125,12,1,125,23,1,125,26,0,125,28,1,126,2,0,126,6,0,126,18,1,126,24,1,127,3,1,127,14,0,127,27,0,127,29,1,128,6,1,128,13,1,128,25,1,129,6,0,129,28,0,130,26,1,131,11,0,131,14,1,131,17,1,131,27,1,131,29,0,132,28,1,133,6,1,133,10,0,133,12,0,133,15,0,133,30,0,134,5,1,134,6,0,134,7,0,134,22,0,134,23,0,135,13,0,135,15,1,135,21,0,135,24,0,135,29,1,136,3,0,136,20,0,136,25,0,137,5,0,137,6,1,137,7,1,137,14,0,137,26,0,137,30,1,138,6,0,138,7,0,138,12,1,138,19,0,138,27,0,139,5,1,139,9,0,139,16,1,139,28,0,140,11,1,140,13,1,140,15,0,140,17,0,140,29,0,141,9,1,141,10,1,141,22,1,141,23,1,141,24,1,141,25,1,141,30,0,142,6,1,142,9,0,142,14,1,142,16,0,142,26,1,143,6,0,143,10,0,143,17,1,143,21,1,143,27,1,143,28,1,144,8,1,144,10,1,144,15,1,144,29,1,145,2,1,145,30,1,146,1,0,146,16,1,146,17,0,146,20,1,147,12,0,147,14,0,148,13,0,148,15,0,148,17,1,149,9,1,149,11,0,149,18,0,149,24,0,149,25,0,149,26,0,149,27,0,149,28,0,150,4,1,150,16,0,150,18,1,150,23,0,150,29,0,151,7,1,151,9,0,151,30,0,152,8,0,152,14,1,152,15,1,152,17,0,153,5,0,153,12,1,153,13,1,153,19,1,153,22,0,154,7,0,154,10,0,154,16,1,154,18,0,154,25,1,154,26,1,154,27,1,154,28,1,154,29,1,154,30,1,155,2,0,155,8,1,155,10,1,155,17,1,155,19,0,155,20,0,156,7,1,156,10,0,156,18,1,156,21,0,156,24,1,157,20,1,157,21,1,157,23,1,158,3,1,158,8,0,158,10,1,158,14,0,158,15,0,158,16,0,159,13,0,159,19,1,159,20,0,160,11,1,160,17,0,160,27,0,160,28,0,160,29,0,160,30,0,161,4,0,161,12,0,161,18,0,161,20,1,161,26,0,162,11,0,162,14,1,162,15,1,162,16,1,162,19,0,162,21,0,162,25,0,163,6,1,163,17,1,163,20,0,163,21,1,164,13,1,164,18,1,164,24,0,164,28,1,164,29,1,164,30,1,165,3,0,165,9,1,165,19,1,165,21,0,165,22,1,165,27,1,166,7,0,166,10,0,166,11,1,166,20,1,166,26,1,167,5,1,167,12,1,167,15,0,167,16,0,167,17,0,167,18,0,167,21,1,167,22,0,167,25,1,168,14,0,168,19,0,168,23,0,168,30,0,169,4,1,169,6,0,169,22,1,169,23,1,169,28,0,169,29,0,170,13,0,170,16,1,170,20,0,170,27,0,171,3,1,171,15,1,171,17,1,171,18,1,171,19,1,171,21,0,171,23,0,171,26,0,172,8,1,172,12,0,172,14,1,172,20,1,172,22,0,172,23,1,172,29,1,172,30,1,173,24,1,173,25,0,173,28,1,174,16,0,174,17,0,174,21,1,174,23,0,174,27,1,175,5,0,175,9,0,175,13,1,175,15,0,175,18,0,175,19,0,175,22,1,175,26,1,176,2,1,176,7,1,176,14,0,176,20,0,176,30,0,177,3,0,177,13,0,177,21,0,177,23,1,177,24,0,177,28,0,177,29,0,178,4,0,178,11,0,178,16,1,178,17,1,178,18,1,178,19,1,178,22,0,178,25,1,179,6,1,179,8,0,179,15,1,179,20,1,179,26,0,179,27,0,180,10,1,180,12,1,180,14,1,180,21,1,180,23,0,180,24,1,180,29,1,180,30,1,181,2,0,181,3,1,181,4,1,181,6,0,181,8,1,182,6,1,182,8,0,182,25,0,182,27,1,182,28,1,183,4,0,183,12,0,183,13,1,183,16,0,183,17,0,183,18,0,183,22,1,184,3,0,184,15,0,184,19,0,184,20,0,184,26,1,185,2,1,185,7,0,185,12,1,185,14,0,185,17,1,185,21,0,185,23,1,185,24,0,185,25,1,185,29,0,185,30,0,186,5,1,186,9,1,186,12,0,186,15,1,186,16,1,186,18,1,186,27,0,186,28,0,187,10,0,187,13,0,187,19,1,187,22,0,187,24,1,187,26,0,187,29,1,187,30,1,188,4,1,188,6,0,188,11,1,188,14,1,188,20,1,188,24,0,188,25,0,188,28,1,189,8,1,189,21,1,189,24,1,189,27,1,190,3,1,190,5,0,190,7,1,190,9,0,190,13,1,190,17,0,190,18,0,190,24,0,190,26,1,191,15,0,191,16,0,191,19,0,191,25,1,192,4,0,192,11,0,192,12,1,192,14,0,192,20,0,192,23,0,192,28,0,192,29,0,192,30,0,193,10,1,193,13,0,193,17,1,193,22,1,193,24,1,193,26,0,193,27,0,194,8,0,194,15,1,194,16,1,194,18,1,194,30,1,195,6,1,195,7,0,195,14,1,195,19,1,195,21,0,195,22,0,195,23,1,195,24,0,195,25,0,195,28,1,195,29,1,196,3,0,196,9,1,196,12,0,196,13,1,196,22,1,196,26,1,196,27,1,197,10,0,197,11,1,197,12,1,197,20,1,197,23,0,197,25,1,198,5,1,198,16,0,198,24,1,199,11,0,199,14,0,199,15,0,199,17,0,199,22,0,199,23,1,199,28,0,199,29,0,199,30,0,200,13,0,200,18,0,200,27,0,201,6,0,201,8,1,201,9,0,201,22,1,201,25,0,201,26,0,202,4,1,202,5,0,202,11,1,202,12,0,202,14,1,202,15,1,202,24,0,203,3,1,203,8,0,203,10,1,203,16,1,203,19,0,203,21,1,203,23,0,203,29,1,203,30,1,204,7,1,204,11,0,204,13,1,204,17,1,204,20,0,204,25,1,204,26,1,204,27,1,204,28,1,205,2,0,205,9,1,205,10,0,205,20,1,205,22,0,205,24,1,206,2,1,206,12,1,206,21,0,206,23,1,207,4,0,207,9,0,208,6,1,208,9,1,208,11,1,208,13,0,208,14,0,208,18,1,208,20,0,208,22,1,209,12,0,209,15,0,209,19,1,209,21,1,209,27,0,209,29,0,210,1,1,210,3,0,210,5,1,210,7,0,210,9,0,210,11,0,210,16,0,210,20,1,210,24,0,210,25,0,210,26,0,210,28,0,210,30,0,211,8,1,211,10,1,211,19,0,211,22,0,211,23,0,212,6,0,212,18,0,213,10,0,213,13,1,213,19,1,213,21,0,214,12,1,214,14,1,214,20,0,214,24,1,214,25,1,215,1,0,215,11,1,215,15,1,215,23,1,215,26,1,215,27,1,215,28,1,216,2,0,216,7,1,216,19,0,216,22,1,217,8,0,217,18,1,217,21,1,217,29,1,218,4,1,218,10,1,218,18,0,218,20,1,218,30,1,219,5,0,220,8,1,220,11,0,220,12,0,220,19,1,221,8,0,221,13,0,221,17,0,222,18,1,222,24,0,223,7,0,223,8,1,223,9,1,223,10,0,223,21,0,223,22,0,223,23,0,223,25,0,224,6,1,225,3,1,225,4,0,225,14,0,225,17,1,225,19,0,225,20,0,225,26,0,226,8,0,226,9,0,227,11,1,227,18,0,227,27,0,228,2,1,228,6,0,228,10,1,228,12,1,229,5,1,229,15,0,229,16,1,229,22,1,229,30,0,230,8,1,230,13,1,230,15,1,230,17,0,230,20,1,230,21,1,230,23,1,231,7,1,231,13,0,231,15,0,231,19,1,231,24,1,232,9,1,232,13,1,232,30,1,233,15,1,233,16,0,233,18,1,233,25,1,234,3,0,234,8,0,234,17,1,234,30,0,235,2,0,236,1,1,236,7,0,236,15,0,237,5,0,237,16,1,237,29,0,237,30,1,238,4,1,238,6,1,238,8,1,238,10,0,239,9,0,239,11,0,239,14,1,240,14,0,240,15,1,240,28,0,240,29,1,241,1,0,241,7,1,241,19,0,241,20,0,241,21,0,241,26,1,242,8,0,242,12,0,242,17,0,242,18,0,243,12,1,243,22,0,243,26,0,243,28,1,244,12,0,244,26,1,245,26,0,245,30,0,246,10,1,246,16,0,246,23,0,246,26,1,246,29,0,247,27,1,248,9,1,248,14,1,248,26,0,249,3,1,249,15,0,249,28,0,250,6,0,250,11,1,250,18,1,250,19,1,250,20,1,251,4,0,251,17,1,251,24,0,252,5,1,252,13,0,252,21,1,252,24,1,253,8,1,253,14,0,253,16,1,253,24,0,253,26,1,253,27,0,253,29,1,254,7,0,254,13,1,255,22,1,1,2,1,1,28,1,2,13,0,2,15,1,2,26,0,3,29,0,4,9,0,4,27,1,5,10,0,5,12,1,5,13,1,5,23,1,6,1,1,6,3,0,7,8,0,7,14,1,8,25,0,9,7,1,9,17,0,9,18,0,9,26,1,10,11,0,10,16,0,10,19,0,11,13,0,11,20,0,12,11,1,12,24,1,13,11,0,13,28,0,14,6,1,14,15,0,14,21,0,15,1,0,15,6,0,17,6,1,17,27,0,18,10,1,18,13,1,18,22,0,19,9,1,20,13,0,20,14,0,21,5,0,21,8,1,21,12,0,21,14,1,21,18,1,21,19,1,22,7,0,22,17,1,22,23,0,23,4,1,23,11,1,23,14,0,23,16,1,23,20,1,23,26,0,24,21,1,24,25,1,24,26,1,25,1,1,25,26,0,26,28,1,27,15,1,27,22,1,27,24,0,28,13,1,28,29,1,30,2,0,30,12,1,30,23,1,31,25,0,34,13,0,34,24,1,34,27,1,35,18,0,35,19,0,35,20,0,35,27,0,35,30,1,36,10,0,36,17,0,36,27,1,37,14,1,37,21,0,37,25,1,38,9,0,38,13,1,38,14,0,39,16,0,39,22,0,39,27,0,40,6,0,40,7,1,40,11,0,40,27,1,41,6,1,41,8,0,41,23,0,41,26,1,41,27,0,42,4,0,42,7,0,43,12,0,43,24,0,44,20,1,44,27,1,45,1,0,45,3,1,45,7,1,45,19,1,45,21,1,45,25,0,45,30,0,46,4,1,46,10,1,46,18,1,46,22,1,46,28,0,47,6,0,47,11,1,47,14,1,47,23,1,47,26,0,48,4,0,48,6,1,48,8,1,48,13,0,48,24,1,49,8,0,49,12,1,49,17,1,49,27,0,49,28,1,50,1,1,50,7,0,50,9,1,50,25,1,51,2,1,52,14,0,52,15,0,52,26,1,52,28,0,53,13,1,53,15,1,54,27,1,55,28,1,55,29,0,56,11,0,56,14,1,56,21,0,56,22,0,56,23,0,56,30,1,57,15,0,57,20,0,57,24,0,57,30,0,58,7,1,58,10,0,58,12,0,58,19,0,58,25,0,58,29,1,59,5,1,59,7,0,59,26,0,60,13,0,60,15,1,60,27,0,60,30,1,61,3,0,61,28,0,62,14,0,63,6,0,63,18,0,63,21,1,63,22,1,63,23,1,63,24,1,63,25,1,63,29,0,64,9,0,64,12,1,64,15,0,64,16,1,64,26,1,64,30,0,65,11,1,65,13,1,65,14,1,65,20,1,65,27,1,66,8,1,66,9,1,66,28,1,67,6,1,67,9,0,67,16,0,67,17,0,67,29,1,68,6,0,68,17,1,68,30,1,69,10,1,69,15,1,69,17,0,70,2,0,70,18,1,71,1,0,71,9,1,71,16,1,71,18,0,71,24,0,71,26,0,72,12,0,72,14,0,72,19,1,72,23,0,72,25,0,72,27,0,72,28,0,73,4,1,73,8,0,73,13,0,73,15,0,73,17,1,73,22,0,73,29,0,73,30,0,74,11,0,75,8,1,75,16,0,75,18,1,75,19,0,76,3,1,76,7,1,76,9,0,76,17,0,76,21,0,76,25,1,76,26,1,76,27,1,76,28,1,77,8,0,77,10,0,77,14,1,77,15,1,77,24,1,77,29,1,77,30,1,78,5,0,78,12,1,78,13,1,78,18,0,78,19,1,78,23,1,79,10,1,79,16,1,80,2,1,80,8,1,80,10,0,80,17,1,80,19,0,80,22,1,81,2,0,81,18,1,82,28,0,83,3,0,83,8,0,83,10,1,83,13,0,83,14,0,83,15,0,83,16,0,83,20,0,83,26,0,83,27,0,83,29,0,83,30,0,84,4,0,84,19,1,84,25,0,85,6,1,85,10,0,85,11,1,85,17,0,85,20,1,85,24,0,86,12,0,86,18,0,87,10,1,87,11,0,87,14,1,87,15,1,87,16,1,87,19,0,87,23,0,87,27,1,87,28,1,87,29,1,87,30,1,88,5,1,88,17,1,88,20,0,88,21,1,88,26,1,89,4,1,89,7,0,89,11,1,89,13,1,89,18,1,89,25,1,90,9,1,90,19,1,91,2,1,91,10,0,91,12,1,91,20,1,91,21,0,91,24,1,92,15,0,92,16,0,92,17,0,92,18,0,92,21,1,92,22,0,92,28,0,92,29,0,92,30,0,93,13,0,93,14,0,93,19,0,93,26,0,93,27,0,94,6,0,95,8,1,95,16,1,95,17,1,95,20,0,95,22,1,95,25,0,95,29,1,95,30,1,96,1,1,96,3,1,96,5,0,96,15,1,96,18,1,96,19,1,96,21,0,96,28,1,97,14,1,97,20,1,97,22,0,97,23,1,97,24,0,97,26,1,97,27,1,98,4,0,98,9,0,98,12,0,99,7,1,99,13,1,99,16,0,99,17,0,99,21,1,99,23,0,99,25,1,100,15,0,100,18,0,100,19,0,100,22,1,100,28,0,100,29,0,100,30,0,101,2,0,101,6,1,101,14,0,101,20,0,102,3,0,102,8,0,102,11,0,102,12,1,102,13,0,102,15,1,102,21,0,102,24,1,102,26,0,102,27,0,103,10,1,103,14,1,103,16,1,103,17,1,103,18,1,103,19,1,103,23,1,103,29,1,103,30,1,104,5,1,104,7,0,104,20,1,104,22,0,104,25,0,104,27,1,104,28,1};
*/
// Fire in words
/*const uint16_t numpasos[] PROGMEM = {328};
const uint16_t angreducido[] PROGMEM = {838};
const uint16_t sizePolarRedu[] PROGMEM = {3438};
const uint8_t PolarRedu[3438] PROGMEM = {0,1,2,0,2,2,0,3,2,0,4,2,0,5,2,0,6,2,0,7,2,0,8,2,0,9,2,0,10,2,0,11,5,0,12,5,0,13,5,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,0,0,20,0,0,21,0,0,22,0,0,23,0,0,24,0,0,25,0,0,26,0,0,27,0,0,28,0,0,29,0,0,30,0,1,10,5,1,14,5,1,15,2,2,9,5,2,15,5,2,16,5,2,17,2,3,17,5,3,18,5,4,8,5,4,17,2,4,18,2,4,19,2,4,20,2,5,7,5,5,17,0,5,18,0,5,19,0,5,20,0,6,15,2,6,16,0,7,15,0,8,6,5,8,14,2,9,10,2,10,5,5,10,9,2,10,11,0,10,15,2,11,8,2,11,10,0,11,14,5,12,9,0,12,14,2,12,15,0,13,7,2,14,8,0,14,14,5,15,6,0,15,7,0,15,12,0,15,14,2,16,14,0,16,20,2,17,4,5,17,13,0,17,19,2,17,20,0,18,5,0,18,17,2,18,18,5,19,15,2,19,16,2,19,17,5,19,18,2,19,19,0,20,14,5,20,15,5,20,16,5,20,18,0,21,17,2,22,4,0,22,13,5,23,3,5,23,13,2,23,17,0,23,21,2,24,18,2,24,20,5,24,22,5,25,13,5,25,16,2,25,17,5,25,20,1,25,21,5,26,18,5,26,19,1,26,22,0,27,13,0,27,16,1,27,18,1,27,20,5,27,21,2,28,13,5,28,19,5,28,20,2,28,21,0,29,17,1,29,18,5,29,20,0,30,3,0,30,15,1,31,17,5,31,19,0,32,20,2,33,15,5,33,16,5,33,19,2,34,18,2,34,19,5,34,20,0,35,12,5,36,18,5,36,19,0,38,11,5,38,12,2,38,13,2,38,18,2,40,23,2,41,14,2,41,18,5,41,19,2,41,22,2,41,23,0,41,25,2,42,14,5,42,18,2,42,19,0,42,22,5,42,25,0,43,10,5,43,11,2,43,14,2,43,21,5,43,22,0,43,24,5,43,27,2,44,18,5,44,23,2,44,26,2,44,27,0,45,16,0,45,18,0,45,20,5,45,23,1,45,24,0,45,26,5,46,14,5,46,15,0,46,17,2,46,21,2,46,25,5,46,26,0,47,17,0,47,20,1,47,21,0,47,22,5,47,24,5,47,25,2,48,2,0,48,10,2,48,19,5,48,21,5,48,23,0,48,25,0,48,29,2,48,30,5,49,9,5,49,13,5,49,20,5,49,23,2,49,25,2,49,29,5,49,30,1,50,14,0,50,23,5,50,30,5,51,18,5,51,21,1,51,24,0,51,28,5,51,30,0,52,12,5,52,21,5,52,24,5,53,25,0,53,26,2,53,27,5,53,29,2,54,25,5,54,26,0,55,18,2,55,26,2,56,9,2,56,13,0,56,17,5,56,25,2,56,26,5,56,29,5,57,29,0,58,8,5,58,25,5,59,18,5,59,19,2,59,20,0,59,28,1,60,17,2,60,18,0,60,19,0,60,21,0,60,28,5,60,30,2,61,16,5,62,17,5,62,22,0,62,29,2,62,30,5,63,12,0,63,23,0,63,29,5,63,30,0,64,17,0,64,24,2,64,25,2,65,19,5,66,11,5,66,26,2,66,28,2,66,29,2,67,16,2,67,23,2,67,28,0,67,29,0,68,8,2,68,16,0,68,19,0,68,27,2,69,15,5,69,27,0,70,18,2,72,26,5,73,15,2,73,18,5,73,26,0,74,7,5,74,22,2,76,11,0,77,15,0,77,25,5,78,18,2,78,20,2,79,18,5,81,20,5,82,19,2,82,25,0,83,19,0,83,20,2,83,21,2,83,25,2,84,17,5,85,19,2,90,19,5,94,17,2,94,20,5,94,25,0,97,17,0,97,18,2,98,21,5,99,25,5,101,19,2,103,20,2,103,21,2,103,25,2,105,11,5,105,21,5,106,21,2,106,24,0,107,7,0,107,21,0,107,25,0,108,26,2,109,24,2,110,22,0,111,18,0,111,20,0,112,26,0,113,20,2,114,20,0,114,27,2,115,11,2,115,20,2,116,20,0,116,23,0,116,27,0,117,20,2,117,24,5,118,12,5,118,19,0,118,25,2,118,28,2,119,8,5,119,24,2,120,24,0,120,28,0,120,30,2,121,25,5,121,29,2,121,30,0,122,25,2,122,29,5,123,8,0,123,20,0,123,29,2,124,12,2,124,21,2,124,25,0,124,26,2,124,29,0,124,30,2,125,13,5,125,30,5,126,30,2,127,21,0,127,26,0,127,30,0,128,26,2,128,27,2,129,9,5,129,22,2,129,27,5,130,13,2,130,22,0,130,27,0,130,28,2,131,14,5,131,27,2,131,28,5,132,9,0,132,26,0,132,28,2,133,2,5,133,28,5,134,27,0,134,29,2,135,14,2,135,15,5,135,27,2,135,28,2,135,30,2,136,10,5,136,27,0,136,28,0,136,29,5,137,28,2,138,10,0,138,15,2,138,28,0,138,29,2,138,30,0,139,16,5,140,16,2,140,29,0,141,11,5,142,17,5,143,11,0,143,17,2,144,18,5,144,19,2,145,2,2,145,12,5,145,18,2,145,20,2,145,21,2,146,12,0,146,20,5,146,21,5,147,15,0,147,20,2,147,22,5,147,23,2,148,13,5,148,16,0,148,17,0,148,18,0,148,23,5,148,24,2,149,13,0,149,19,0,149,21,2,150,14,5,150,21,5,150,22,1,150,24,5,150,25,5,151,3,5,151,15,2,151,20,0,151,21,2,151,22,5,151,25,2,152,14,0,152,15,5,152,21,0,152,22,2,152,24,2,153,16,2,153,22,0,153,23,2,153,25,0,154,15,0,154,16,5,154,23,0,155,15,2,155,17,2,156,16,0,156,18,2,157,15,0,157,16,2,157,17,0,157,23,2,158,3,2,158,15,2,158,17,5,158,19,2,158,24,0,159,4,5,159,15,0,159,16,5,159,18,0,159,20,2,160,18,5,161,16,0,161,19,5,161,21,2,162,17,0,162,20,5,162,21,5,163,5,5,163,18,0,163,22,2,164,4,2,164,19,2,165,19,0,165,22,5,165,23,0,166,6,5,166,20,0,166,21,2,167,5,2,167,21,0,168,7,5,168,22,0,169,6,2,169,18,2,170,8,5,170,16,2,170,19,5,171,7,2,171,9,5,171,17,2,171,18,0,171,19,2,171,20,5,171,21,5,171,22,5,172,8,2,172,10,5,172,16,0,172,17,0,172,18,2,172,20,2,172,22,2,173,9,2,173,11,5,173,12,5,173,17,2,173,19,5,173,20,5,174,10,2,174,13,5,174,14,5,174,15,2,174,16,2,174,18,5,175,11,2,175,12,2,175,13,2,175,14,2,175,20,2,175,21,2,176,11,0,176,18,2,176,19,2,176,20,0,176,21,0,177,9,0,177,12,0,177,13,0,177,14,0,177,15,0,177,17,0,177,18,0,177,19,0,178,10,0,178,16,0,182,21,2,183,12,2,184,13,2,185,10,2,185,11,2,185,14,2,185,15,2,185,17,2,186,9,2,186,16,2,186,18,2,186,19,2,186,20,2,188,16,5,188,17,5,188,19,5,188,20,5,188,21,5,189,14,5,189,15,5,189,16,2,189,17,2,189,20,1,189,21,1,190,13,5,190,15,2,190,18,5,190,20,5,191,12,5,191,13,0,191,14,2,191,15,0,191,16,0,191,17,5,191,21,5,191,22,5,192,11,5,192,12,0,192,14,0,192,16,2,192,17,2,192,19,2,192,22,2,193,11,2,193,16,0,193,18,2,193,20,0,193,21,2,193,22,0,194,17,0,194,19,0,194,21,0,195,11,0,195,18,0,197,10,0,199,9,0,201,22,2,201,23,2,202,18,2,202,19,2,202,20,2,203,9,2,203,14,2,203,15,2,203,16,2,203,17,2,203,19,0,203,20,0,203,22,0,203,23,0,203,24,2,204,11,2,204,12,2,204,13,2,204,17,0,204,18,0,205,7,5,205,10,2,205,16,0,206,5,5,206,14,0,206,15,0,207,13,0,207,24,0,208,6,5,208,25,2,209,8,5,210,7,2,210,22,2,210,24,5,211,8,2,211,21,2,211,23,5,211,25,5,212,19,2,212,20,2,212,21,5,212,22,5,212,26,2,213,4,5,213,12,0,213,18,2,213,19,5,213,20,5,213,23,2,214,12,2,214,15,2,214,16,2,214,17,2,214,18,5,214,22,2,214,24,0,215,5,1,215,12,0,215,17,5,215,20,1,215,21,2,215,22,0,215,23,5,215,24,2,215,26,5,215,27,2,216,14,2,216,16,5,216,19,1,216,20,5,216,21,0,216,23,0,216,26,2,217,12,2,217,13,2,217,15,5,217,18,2,217,20,0,217,22,2,217,24,5,218,4,2,218,17,2,218,19,5,218,22,0,218,24,2,218,26,0,218,27,0,218,28,2,219,5,5,219,14,5,219,15,1,219,16,1,219,17,0,219,18,5,219,23,2,219,24,5,220,15,5,220,19,0,220,23,0,220,25,2,220,28,0,221,13,5,221,16,2,221,17,2,221,23,2,221,25,0,221,29,2,222,5,2,222,13,1,222,14,1,222,15,1,222,16,0,222,18,0,222,24,2,222,30,2,223,6,1,223,12,5,223,22,2,223,23,5,223,24,0,224,5,5,224,7,5,224,13,5,224,14,5,224,15,0,224,17,5,224,22,0,224,23,2,225,4,5,225,11,5,225,17,0,225,23,0,225,28,5,226,3,5,226,4,2,226,22,5,226,27,2,226,28,1,226,29,1,227,7,2,227,16,2,227,22,2,227,28,2,227,30,5,228,7,5,228,10,5,228,14,0,228,21,5,228,22,0,228,26,2,228,27,5,228,28,1,228,29,5,229,12,2,229,16,0,229,27,2,229,30,1,230,21,2,230,27,1,230,28,5,230,29,2,231,10,2,231,11,2,231,12,0,231,13,2,231,15,2,231,21,0,231,25,2,231,26,0,231,27,5,231,28,0,231,29,5,231,30,5,232,4,0,232,20,2,232,24,2,232,25,0,232,27,0,232,28,5,232,29,2,233,6,5,233,13,0,233,15,0,233,26,5,233,28,0,233,29,0,233,30,2,234,12,2,234,24,5,234,26,2,234,27,2,234,29,2,234,30,5,235,20,0,235,24,0,235,26,0,235,29,0,235,30,2,236,3,0,236,11,0,236,19,5,236,23,2,236,25,2,236,27,0,236,30,1,237,12,0,237,19,2,237,23,5,238,6,1,238,25,0,238,30,5,239,22,2,239,23,0,239,29,5,240,4,5,240,10,5,240,18,5,241,10,2,241,19,0,241,22,5,241,26,2,242,10,5,242,22,2,243,5,1,243,18,2,243,22,0,243,26,0,243,28,5,243,29,2,244,25,2,245,6,5,245,10,2,245,28,2,245,29,0,246,10,5,246,21,2,246,29,5,246,30,0,247,17,2,247,28,0,247,30,2,248,24,2,248,25,0,248,30,0,249,21,0,251,28,2,252,5,5,252,23,2,252,29,2,253,6,1,253,7,1,253,29,0,254,7,5,254,20,2,254,22,2,255,21,2,255,24,0,1,6,5,1,19,2,1,28,5,2,5,2,2,16,2,3,28,0,4,20,5,4,21,5,6,9,5,6,20,2,7,8,5,7,27,2,8,4,2,9,7,1,10,22,5,10,27,0,11,11,2,12,11,0,12,20,0,14,5,0,14,6,1,14,7,5,15,5,2,15,6,5,15,7,1,16,10,2,17,5,0,17,6,1,17,7,5,17,23,5,18,22,2,19,11,2,21,11,5,22,16,5,23,21,0,24,27,2,27,4,0,27,22,0,28,20,5,28,22,2,28,23,0,28,27,5,29,16,0,30,10,5,30,22,0,30,26,2,31,26,0,32,7,0,32,20,2,32,26,2,33,6,5,33,26,0,33,28,2,34,5,5,34,24,5,34,26,2,35,28,5,36,11,2,36,17,5,36,24,0,37,11,5,37,21,5,37,26,5,39,12,5,39,17,0,40,9,2,40,10,2,40,11,2,40,21,2,40,25,2,40,29,5,41,6,0,41,18,5,41,25,5,42,9,5,42,22,2,42,24,5,42,28,1,43,5,0,43,22,5,43,23,5,43,27,1,43,28,5,44,8,2,44,26,1,44,28,1,44,30,1,45,7,5,45,29,2,45,30,5,46,8,0,46,18,0,46,25,1,46,27,5,46,28,5,46,29,0,46,30,2,47,19,5,47,21,5,47,24,1,47,26,5,47,28,2,47,29,5,48,13,5,48,20,5,48,24,5,48,27,1,48,28,0,48,29,1,48,30,0,49,12,2,49,25,5,49,27,5,49,29,2,50,3,5,50,7,2,50,25,1,50,27,2,50,28,2,51,26,1,51,28,5,51,29,0,51,30,5,52,25,5,52,26,2,52,27,0,52,28,2,52,30,0,53,6,2,53,26,5,53,27,2,53,28,0,53,29,2,54,6,0,54,9,0,54,14,5,54,24,1,54,25,0,54,27,5,55,7,0,55,10,5,55,24,5,55,25,5,55,27,0,55,28,2,55,29,0,56,27,2,56,28,0,56,30,2,57,23,1,57,25,1,57,26,0,57,27,5,57,30,0,58,15,5,58,23,5,58,25,5,58,27,2,59,21,2,59,22,0,59,26,5,59,27,0,59,28,2,60,3,2,60,8,2,60,19,0,60,21,5,60,22,2,60,28,0,61,8,0,61,11,5,61,21,1,61,22,0,61,23,2,61,27,2,62,11,2,62,14,1,62,16,5,62,20,2,62,21,5,62,23,0,62,25,2,63,10,0,63,11,5,63,20,0,63,22,2,63,24,0,63,25,5,63,26,2,64,14,5,64,15,2,64,21,0,64,22,5,64,26,0,64,27,0,65,11,2,65,13,2,65,15,1,65,17,2,65,25,0,65,26,2,66,11,5,66,13,5,66,22,0,66,23,5,66,26,0,67,16,2,67,17,5,67,23,2,68,4,5,68,15,5,68,16,5,68,18,2,68,23,0,68,24,2,69,13,2,69,17,0,69,24,0,70,11,0,71,11,5,71,12,5,71,13,5,71,17,2,71,18,0,72,11,0,72,12,2,72,17,1,73,4,2,73,12,5,73,17,5,74,18,2,75,18,5,76,5,5,77,19,5,78,16,2,79,16,5,79,17,2,79,20,2,80,5,2,80,17,0,80,18,0,80,19,2,80,20,5,80,21,2,81,6,5,81,17,2,81,20,2,82,15,2,82,19,0,83,14,2,83,15,5,83,16,0,83,17,5,83,20,0,83,21,0,83,22,2,84,14,5,84,15,0,84,16,2,84,22,0,85,6,2,85,7,5,85,17,0,85,18,2,86,15,2,86,16,0,86,18,0,87,15,5,88,7,2,88,8,5,88,15,2,88,16,2,89,17,2,90,8,2,90,9,5,90,14,2,90,18,2,91,10,5,91,11,5,91,14,5,91,15,0,91,16,0,92,9,2,92,15,2,92,17,0,92,18,0,93,10,2,94,15,5,94,16,2,95,17,2,97,16,5,98,17,5,99,18,5,99,19,2,99,20,2,100,14,1,100,19,5,101,14,0,101,15,0,101,16,0,101,19,2,101,20,0,102,14,2,102,17,0,102,18,0,102,19,0,103,14,0,104,9,5};
*/
CRGB leds[NUM_STRIPS][NUM_LEDS];
unsigned int numled;
int angAux = 0;
int anginicio = 360;
int kinicial = 0;
int angulo[NUM_STRIPS]; // angle 0
unsigned int ang[NUM_STRIPS];// = 360;
unsigned int k[NUM_STRIPS];
unsigned int x[NUM_STRIPS];
unsigned int y[NUM_STRIPS];
bool pasa = false; // happens
bool cambiaLed = false;
long tiempoDibujo = 0; // time drawing
long periodo = 0; // period
long periodoini = 0; // initial period
long previoustime = 0;
long tiempo = 0; // time
long contaseconds = 0; // consist seconds
long tvariable = 0;
int tiempoescritura = 700; // writing time
byte LedColour = 0;
byte vred = 0;
byte vgreen = 0;
byte vblue = 0;
int contaang = 0;
long tiempoanimate = 0;
unsigned long StartTime = 0;
unsigned long TotalTime = 0;
void precompute(){
unsigned int i = 0 ;
unsigned int angle = 0;
unsigned int angular;
int m = 0;
for(int j = 0; j < NUM_STRIPS; j++){
k[j] = 0;
x[j] = 0;
}
x[0] = pgm_read_word_near(sizePolarRedu + 0);
angular = pgm_read_byte(PolarRedu + i);
/*if (i / 3 >= pgm_read_word_near(angreducido + 0)) {
angular += 255;
}*/
for (angle = 0; angle < 360; angle++) {
while (angular == angle){
for(int j = 0, l = 0; j < 360; j += (360 / NUM_STRIPS)){
y[l] = j;
if(l != 0){
if(angle >= j && x[l] == 0){
x[l] = i;
m++;
if(m == NUM_STRIPS - 1){
return;
}
}
}
l++;
}
i += 3;
if (i >= pgm_read_word_near(sizePolarRedu + 0)) {
angular = 999;
}
else{
angular = pgm_read_byte(PolarRedu + i); // value in the array PolarRedu at position value of k
if (i / 3 >= pgm_read_word_near(angreducido + 0)) {
angular += 255;
}
}
}
} // end of For loop
/*Serial.println(x[1]);
Serial.println(x[2]);
Serial.println(x[0]);
Serial.println("Ready");*/
}
void get_value(){
for(int i = 0; i < NUM_STRIPS; i++){
k[i] = x[i];
ang[i] = y[i];
//Serial.println(ang[i]);
if(k[i] >= pgm_read_word_near(sizePolarRedu + 0)){
k[i] = 0;
}
}
}
void pasaIman() {
pasa = true;
Serial.println("TRUE");
}
void setup() {
//Para resetear
//pinMode(A1, INPUT);
//digitalWrite(A1, LOW);
//BT.begin(9600); //Velocidad del puerto del módulo Bluetooth
/* // Disable WiFi
WiFi.mode(WIFI_OFF);
// Disable BLUEtooth
BLEDevice::deinit();
*/
Serial.begin(9600);
///////////////////////////////////////////////////////////////////////////////////////
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds[0], NUM_LEDS + pgm_read_byte(offset1 + 0)); // LED TYpe WS2812b
if(NUM_STRIPS > 1){
FastLED.addLeds<LED_TYPE, DATA_PIN+1, COLOR_ORDER>(leds[1], NUM_LEDS + pgm_read_byte(offset1 + 0));
}
if(NUM_STRIPS > 2){
FastLED.addLeds<LED_TYPE, DATA_PIN+2, COLOR_ORDER>(leds[2], NUM_LEDS + pgm_read_byte(offset1 + 0));
}
if(NUM_STRIPS > 3){
FastLED.addLeds<LED_TYPE, DATA_PIN+3, COLOR_ORDER>(leds[3], NUM_LEDS + pgm_read_byte(offset1 + 0)); // LED TYpe WS2812b
}
FastLED.setBrightness(pgm_read_byte(brillo + 0));
FastLED.setCorrection( TypicalLEDStrip );
attachInterrupt(digitalPinToInterrupt(HALL_SENSOR_PIN), pasaIman, RISING);
for(int i = 0; i < NUM_STRIPS; i++){
memset(leds[i], 0, NUM_LEDS * 3);
}
FastLED.show();
delay(100);
//FastLED[0].showLeds(0);
//FastLED[1].showLeds(0);
//FastLED[2].showLeds(0);
precompute();
}
void loop() {
if (pasa == true) {
pasa = false;
StartTime = millis();
tiempo = micros();
periodoini = tiempo - previoustime;
periodo = tiempo - previoustime - tvariable ;
//periodo teorico //Theoretical Period
tiempoDibujo = periodo / 360;
if (tiempoDibujo < 0) tiempoDibujo = 0;
previoustime = tiempo;
if(NUM_STRIPS > 1){
get_value();
}
else{
k[0] = 0;
}
for(int i = 0; i < NUM_STRIPS; i++){
angulo[i] = pgm_read_byte(PolarRedu + k[i]);
if (k[i] / 3 >= pgm_read_word_near(angreducido + 0)) {
angulo[i] += 255;
}
}
contaang = 0;
for (ang[0] = 0; ang[0] < 360; ang[0]++) {
contaang++; // value 1 to 360
cambiaLed = false;
for(int a = 1; a < NUM_STRIPS; a++){
if(ang[0] !=0) ang[a]++;
if(ang[a] >= 360){
ang[a] -= 360;
}
}
for( int i = 0; i < NUM_STRIPS; i++){
while(angulo[i] == ang[i]){
cambiaLed = true;
if (pgm_read_byte(radio1directo + 0) == 1) {
// PolarRedu=0; k= 0,3,6,9,12...+3..675,678,681(3 less than PolarRedu[684])
// pgm_read_byte(offset1 + 0) = pgm_read_byte(0 + 0) = 0;
numled = pgm_read_byte(PolarRedu + k[i] + 1) - 1 + pgm_read_byte(offset1 + 0);// PolarRedu[684] / 3 = 228 readings
}
else {
//inverso es cero // inverse is zero
//numled = pgm_read_byte(num_leds + 0) - pgm_read_byte(PolarRedu + k+1) + pgm_read_byte(offset1 + 0); // No readings
numled = NUM_LEDS - pgm_read_byte(PolarRedu + k[i] + 1) + pgm_read_byte(offset1 + 0); // No reading
}
LedColour = pgm_read_byte(PolarRedu + k[i] + 2); // PolarRedu[684] / 3 = 228 readings
if(numled < NUM_LEDS){
vred = 0;
vgreen = 0;
vblue = 0;
if(LedColour == 4 || LedColour == 6 || LedColour == 7 || LedColour == 1) {
vblue = 255;
}
if(LedColour == 3 || LedColour == 5 || LedColour == 6 || LedColour == 1) {
vgreen = 255;
}
if(LedColour == 2 || LedColour == 5 || LedColour == 7 || LedColour == 1) {
vred = 255;
}
leds[i][numled].r = vred;
leds[i][numled].g = vgreen;
leds[i][numled].b = vblue;
}
k[i] += 3;
if(i != 0){
if(k[i] > pgm_read_word_near(sizePolarRedu + 0)){
k[i] -= (pgm_read_word_near(sizePolarRedu + 0) + 3);
}
}
if(k[i] == x[i]){
//if (k[i] >= pgm_read_word_near(sizePolarRedu + 0) && k[i] == x[i]) {
angulo[i] = 999;
}
/*else if(k[i] == pgm_read_word_near(sizePolarRedu + 0) && i != 0)
{
// Do Nothing
}*/
else{
angulo[i] = pgm_read_byte(PolarRedu + k[i]); // value in the array PolarRedu at position value of k
if (k[i] / 3 >= pgm_read_word_near(angreducido + 0)) {
angulo[i] += 255;
}
}
} // End of while loop
if (cambiaLed == true){
FastLED[i].showLeds(pgm_read_byte(brillo + 0));
}
} // End of for(int i = 0; i < NUM_STRIPS; i++){
if (cambiaLed == true) {
if (tiempoDibujo > tiempoescritura) {
delayMicroseconds(tiempoDibujo - tiempoescritura);
}
}
else {
if (tiempoDibujo > tiempoescritura) {
delayMicroseconds(tiempoDibujo + tiempoescritura * pgm_read_word_near(numpasos + 0) / (360 - pgm_read_word_near(numpasos + 0)));
}
else {
delayMicroseconds(tiempoDibujo * 360 / (360 - pgm_read_word_near(numpasos + 0)));
}
}
if (pasa == true) {
//To add somthing that is considered positive to the variable
tvariable += (micros() - previoustime) * 360 /contaang - periodoini;
if (tvariable > 500000 || tvariable < -500000) {
tvariable = 0;
}
return;
}
// To add a negative value to a variable
tvariable += (micros() - previoustime) - periodoini;
if (tvariable > 500000 || tvariable < -500000) {
tvariable = 0;
}
} // End For Ang
TotalTime = millis() - StartTime;
Serial.println(TotalTime);
StartTime = 0;
} // endif (pasa == true)
} // end of void
////////////////////////////////////////////
/*else if(pasa == false){
int n = 20;
while (n-- != 0 && pasa == false) {
delay(100);
}
if(pasa == true) return;
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
for(int x = 0; x < NUM_STRIPS; x++){
leds[x][i] = CRGB::Blue;
}
FastLED.show();
FastLED.clear();
//Serial.println(pasa);
if(pasa == true){
FastLED.clear();
return;
}
delay(100);
}
}*/