3rd year levitator

Dependencies:   MovingAverage NOKIA_5110 PinDetect mbed

Committer:
Generic
Date:
Sun Sep 09 18:45:52 2018 +0000
Revision:
0:d7cc9bad311b
Test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Generic 0:d7cc9bad311b 1 #include "Pattern.h"
Generic 0:d7cc9bad311b 2
Generic 0:d7cc9bad311b 3 char pattern1[ROWS][COLUMNS] = {
Generic 0:d7cc9bad311b 4 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 5 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 6 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x041,0x041,0x07F,0x07F,0x041,0x041,0x00,0x00,0x00,0x01C,0x03E,0x062,0x041,0x041,0x041,0x00,0x07C,0x0E,0x0B,0x09,0x0B,0x0E,0x07C,0x00,0x07F,0x07F,0x06,0x0C,0x018,0x03F,0x07F,0x00,0x00,0x00,0x07F,0x07F,0x08,0x08,0x08,0x07F,0x07F,0x00,0x07C,0x0E,0x0B,0x09,0x0B,0x0E,0x07C,0x00,0x061,0x071,0x049,0x047,0x043,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 7 {0x07F,0x07F,0x040,0x040,0x040,0x040,0x00,0x07F,0x07F,0x049,0x049,0x049,0x049,0x049,0x00,0x07,0x0F,0x018,0x030,0x060,0x040,0x060,0x030,0x018,0x0F,0x07,0x00,0x00,0x041,0x041,0x07F,0x07F,0x041,0x041,0x00,0x03,0x03,0x03,0x07F,0x07F,0x03,0x03,0x03,0x00,0x07C,0x0E,0x0B,0x09,0x0B,0x0E,0x07C,0x00,0x00,0x03,0x03,0x03,0x07F,0x07F,0x03,0x03,0x03,0x00,0x041,0x041,0x07F,0x07F,0x041,0x041,0x00,0x01C,0x022,0x041,0x041,0x041,0x022,0x01C,0x00,0x07F,0x07F,0x06,0x0C,0x018,0x03F,0x07F},
Generic 0:d7cc9bad311b 8 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 9 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
Generic 0:d7cc9bad311b 10 };
Generic 0:d7cc9bad311b 11
Generic 0:d7cc9bad311b 12 char pattern2[ROWS][COLUMNS] = {
Generic 0:d7cc9bad311b 13 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07F,0x071,0x011,0x011,0x01F,0x00,0x07F,0x011,0x011,0x011,0x011,0x011,0x02A,0x044,0x00,0x07F,0x07F,0x049,0x049,0x049,0x049,0x049,0x00,0x046,0x049,0x049,0x049,0x049,0x031,0x00,0x046,0x049,0x049,0x049,0x049,0x031,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 14 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07F,0x07F,0x049,0x049,0x049,0x049,0x049,0x036,0x00,0x07F,0x07F,0x040,0x040,0x040,0x040,0x00,0x03F,0x03F,0x060,0x060,0x060,0x060,0x060,0x03F,0x03F,0x00,0x07F,0x07F,0x049,0x049,0x049,0x049,0x049,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 15 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07F,0x07F,0x049,0x049,0x049,0x049,0x049,0x036,0x00,0x03F,0x03F,0x060,0x060,0x060,0x060,0x060,0x03F,0x03F,0x00,0x00,0x03,0x03,0x03,0x07F,0x07F,0x03,0x03,0x03,0x00,0x00,0x03,0x03,0x03,0x07F,0x07F,0x03,0x03,0x03,0x00,0x01C,0x022,0x041,0x041,0x041,0x022,0x01C,0x00,0x07F,0x07F,0x06,0x0C,0x018,0x03F,0x07F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 16 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x080,0x0C0,0x0E0,0x0F0,0x0F8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x080,0x040,0x020,0x010,0x010,0x090,0x090,0x090,0x010,0x010,0x020,0x040,0x080,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 17 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01C,0x03E,0x07F,0x0FF,0x0FF,0x0FF,0x0FF,0x0FF,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x01F,0x00,0x01F,0x020,0x040,0x080,0x0E,0x01F,0x03F,0x03F,0x03F,0x01F,0x0E,0x080,0x040,0x020,0x01F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
Generic 0:d7cc9bad311b 18 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
Generic 0:d7cc9bad311b 19 };
Generic 0:d7cc9bad311b 20
Generic 0:d7cc9bad311b 21 void DisplayPattern(NokiaLcd *lcd, int pattern_num)
Generic 0:d7cc9bad311b 22 {
Generic 0:d7cc9bad311b 23 lcd->ClearLcdMem();
Generic 0:d7cc9bad311b 24 lcd->SetXY(0,0);
Generic 0:d7cc9bad311b 25
Generic 0:d7cc9bad311b 26 for( int i = 0; i < ROWS ; i++ )
Generic 0:d7cc9bad311b 27 {
Generic 0:d7cc9bad311b 28 for( int j = 0; j < COLUMNS ; j++)
Generic 0:d7cc9bad311b 29 {
Generic 0:d7cc9bad311b 30 if( pattern_num == 1 )
Generic 0:d7cc9bad311b 31 {
Generic 0:d7cc9bad311b 32 lcd->SendDrawData(pattern1[i][j]);
Generic 0:d7cc9bad311b 33 }
Generic 0:d7cc9bad311b 34 else
Generic 0:d7cc9bad311b 35 {
Generic 0:d7cc9bad311b 36 lcd->SendDrawData(pattern2[i][j]);
Generic 0:d7cc9bad311b 37 }
Generic 0:d7cc9bad311b 38
Generic 0:d7cc9bad311b 39
Generic 0:d7cc9bad311b 40 }
Generic 0:d7cc9bad311b 41 }
Generic 0:d7cc9bad311b 42 }