lol shield flying plane

I try to make a plane is moving  through the moving of cloud . Fortunately , everything works well .

 

 

 

PROGMEM const uint16_t BitMap[][9] = {
//Diaganal swipe across the screen
{ 6 ,
6159 ,
15424 ,
320 ,
496 ,
320 ,
70 ,
6159 ,
15360 },

{ 6 ,
6159 ,
15424 ,
320 ,
496 ,
320 ,
70 ,
6159 ,
15360 },

{ 6 ,
6159 ,
15424 ,
320 ,
496 ,
320 ,
70 ,
6159 ,
15360 },

{ 24 ,
8252 ,
12352 ,
320 ,
496 ,
320 ,
65 ,
1539 ,
3840 },

{ 24 ,
8252 ,
12352 ,
320 ,
496 ,
320 ,
65 ,
1539 ,
3840 },

{ 24 ,
8252 ,
12352 ,
320 ,
496 ,
320 ,
65 ,
1539 ,
3840 },

{ 96 ,
240 ,
64 ,
320 ,
496 ,
320 ,
64 ,
384 ,
960 },

{ 96 ,
240 ,
64 ,
320 ,
496 ,
320 ,
64 ,
384 ,
960 },

{ 96 ,
240 ,
64 ,
320 ,
496 ,
320 ,
64 ,
384 ,
960 },

{ 768 ,
1921 ,
67 ,
320 ,
496 ,
320 ,
8256 ,
12384 ,
240 },

{ 768 ,
1921 ,
67 ,
320 ,
496 ,
320 ,
8256 ,
12384 ,
240 },

{ 768 ,
1921 ,
67 ,
320 ,
496 ,
320 ,
8256 ,
12384 ,
240 },

{ 3072 ,
7686 ,
79 ,
320 ,
496 ,
320 ,
6208 ,
15384 ,
60 },

{ 3072 ,
7686 ,
79 ,
320 ,
496 ,
320 ,
6208 ,
15384 ,
60 },

{ 3072 ,
7686 ,
79 ,
320 ,
496 ,
320 ,
6208 ,
15384 ,
60 },

{ 12288 ,
14360 ,
60 ,
320 ,
496 ,
320 ,
1600 ,
3846 ,
15 },

{ 0 ,
97 ,
240 ,
320 ,
496 ,
320 ,
448 ,
961 ,
3 },

{ 0 ,
97 ,
240 ,
320 ,
496 ,
320 ,
448 ,
961 ,
3 },

{ 0 ,
97 ,
240 ,
320 ,
496 ,
320 ,
448 ,
961 ,
3 },

{ 3 ,
391 ,
960 ,
320 ,
496 ,
320 ,
96 ,
8432 ,
12288 },

{ 3 ,
391 ,
960 ,
320 ,
496 ,
320 ,
96 ,
8432 ,
12288 },

{ 3 ,
391 ,
960 ,
320 ,
496 ,
320 ,
96 ,
8432 ,
12288 },

{ 12 ,
1566 ,
3840 ,
320 ,
496 ,
320 ,
24 ,
6204 ,
15360 },

{ 12 ,
1566 ,
3840 ,
320 ,
496 ,
320 ,
24 ,
6204 ,
15360 },

{0, 0, 0, 0, 0, 0, 0, 0, 0},
{18000}
};

void setup() {
LedSign::Init(DOUBLE_BUFFER | GRAYSCALE); //Initializes the screen
}
void loop() {
for (uint8_t gray = 1; gray < SHADES; gray++)
DisplayBitMap(gray); //Displays the bitmap
}

void DisplayBitMap(uint8_t grayscale)
{
boolean run=true; //While this is true, the screen updates
byte frame = 0; //Frame counter
byte line = 0; //Row counter
unsigned long data; //Temporary storage of the row data
unsigned long start = 0;

while(run == true) {

for(line = 0; line < 9; line++) {

//Here we fetch data from program memory with a pointer.
data = pgm_read_word_near (&BitMap[frame][line]);

//Kills the loop if the kill number is found
if (data==18000){
run=false;
}

//This is where the bit-shifting happens to pull out
//each LED from a row. If the bit is 1, then the LED
//is turned on, otherwise it is turned off.
else for (byte led=0; led<14; ++led) {
if (data & (1<<led)) {
LedSign::Set(led, line, grayscale);
}
else {
LedSign::Set(led, line, 0);
}
}
}

LedSign::Flip(true);

unsigned long end = millis();
unsigned long diff = end – start;
if ( start && (diff < blinkdelay) )
delay( blinkdelay – diff );
start = end;

frame++;
}
}

Leave a Reply

Your email address will not be published.