Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Testing code for driving UG2828GDEAF01 1,5# OLED
- ZhangFeng, PRC.
- http://vfdclock.jimdo.com
- 09-12-2013
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define FASTIO 0
- // 4-wire SPI(BS1=0; BS2=0)
- #define RST_PIN 8
- #define CS_PIN 9
- #define DC_PIN 10
- #define DIN_PIN 11
- #define CLK_PIN 12
- #define HVEN_PIN 13
- #define DODELAY __asm__("nop\n\t""nop\n\t");
- #define COUNTOF(arr) (sizeof(arr) / sizeof(arr[0]))
- #ifndef FASTIO
- // rst
- #define OLED_RES_1 digitalWrite(RST_PIN, HIGH)
- #define OLED_RES_0 digitalWrite(RST_PIN, LOW)
- // cs
- #define OLED_CS_1 digitalWrite(CS_PIN, HIGH)
- #define OLED_CS_0 digitalWrite(CS_PIN, LOW)
- // DC (Data or Command)
- #define OLED_DC_1 digitalWrite(DC_PIN, HIGH)
- #define OLED_DC_0 digitalWrite(DC_PIN, LOW)
- // data in
- #define OLED_DIN_1 digitalWrite(DIN_PIN, HIGH)
- #define OLED_DIN_0 digitalWrite(DIN_PIN, LOW)
- // clock
- #define OLED_CLK_1 digitalWrite(CLK_PIN, HIGH)
- #define OLED_CLK_0 digitalWrite(CLK_PIN, LOW)
- // HVEN(optional)
- #define OLED_HVEN_1 digitalWrite(HVEN_PIN, HIGH)
- #define OLED_HVEN_0 digitalWrite(HVEN_PIN, LOW)
- #else
- // Fast IO version
- // pin map please check: http://arduino.cc/en/Hacking/Atmega168Hardware
- // pin11 = pb3; pin12 = pb4; pin15 = pb5
- #define GPIO_Pin_0 (0x01) /* Pin 0 selected */
- #define GPIO_Pin_1 (0x02) /* Pin 1 selected */
- #define GPIO_Pin_2 (0x04) /* Pin 2 selected */
- #define GPIO_Pin_3 (0x08) /* Pin 3 selected */
- #define GPIO_Pin_4 (0x10) /* Pin 4 selected */
- #define GPIO_Pin_5 (0x20) /* Pin 5 selected */
- #define GPIO_Pin_6 (0x40) /* Pin 6 selected */
- #define GPIO_Pin_7 (0x80) /* Pin 7 selected */
- #define RES_PORT PORTB
- #define CS_PORT PORTB
- #define DC_PORT PORTB
- #define DIN_PORT PORTB
- #define CLK_PORT PORTB
- #define HVEN_PORT PORTB
- #define RES_PORTPIN GPIO_Pin_0
- #define CS_PORTPIN GPIO_Pin_1
- #define DC_PORTPIN GPIO_Pin_2
- #define DIN_PORTPIN GPIO_Pin_3
- #define CLK_PORTPIN GPIO_Pin_4
- #define HVEN_PORTPIN GPIO_Pin_5
- #define OLED_RES_1 RES_PORT |= (RES_PORTPIN)
- #define OLED_RES_0 RES_PORT &= ~(RES_PORTPIN)
- #define OLED_CS_1 CS_PORT |= (CS_PORTPIN)
- #define OLED_CS_0 CS_PORT &= ~(CS_PORTPIN)
- #define OLED_DC_1 DC_PORT |= (DC_PORTPIN)
- #define OLED_DC_0 DC_PORT &= ~(DC_PORTPIN)
- #define OLED_DIN_1 DIN_PORT |= (DIN_PORTPIN)
- #define OLED_DIN_0 DIN_PORT &= ~(DIN_PORTPIN)
- #define OLED_CLK_1 CLK_PORT |= (CLK_PORTPIN)
- #define OLED_CLK_0 CLK_PORT &= ~(CLK_PORTPIN)
- #define OLED_HVEN_1 HVEN_PORT |= (HVEN_PORTPIN)
- #define OLED_HVEN_0 HVEN_PORT &= ~(HVEN_PORTPIN)
- #endif
- #define Max_Column 0x7f // 128-1
- #define Max_Row 0x7f // 128-1
- #define Brightness 0x0F
- #define MAKECOLOR64k(r,g,b) (unsigned short int)((((unsigned short int)(r)>>3)<<11)|(((unsigned short int)(g)>>2)<<5)|((unsigned short int)(b)>>3))
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Delay Time
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void uDelay(unsigned char l)
- {
- while(l--)
- {
- __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
- __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
- };
- }
- void Write_Command(unsigned char Data)
- {
- unsigned char i;
- OLED_CS_0;
- OLED_DC_0;
- for (i=0; i<8; i++)
- {
- OLED_CLK_0;
- //((Data&0x80)>>7)?OLED_DIN_1:OLED_DIN_0;
- if((Data&0x80)>>7)
- OLED_DIN_1;
- else
- OLED_DIN_0;
- Data = Data << 1;
- uDelay(1);
- OLED_CLK_1;
- uDelay(1);
- }
- OLED_CLK_0;
- OLED_DC_1;
- OLED_CS_1;
- }
- void Write_Data(unsigned char Data)
- {
- unsigned char i;
- OLED_CS_0;
- OLED_DC_1;
- for (i=0; i<8; i++)
- {
- OLED_CLK_0;
- if((Data&0x80)>>7)
- OLED_DIN_1;
- else
- OLED_DIN_0;
- Data = Data << 1;
- uDelay(1);
- OLED_CLK_1;
- uDelay(1);
- }
- OLED_CLK_0;
- OLED_DC_1;
- OLED_CS_1;
- }
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Gray Scale Table Setting (Full Screen)
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void Set_Gray_Scale_Table(void)
- {
- Write_Command(0xB8);
- Write_Data(0x01); // Gray Scale Level 1
- Write_Data(0x03); // Gray Scale Level 3
- Write_Data(0x05); // Gray Scale Level 5
- Write_Data(0x07); // Gray Scale Level 7
- Write_Data(0x0B); // Gray Scale Level 9
- Write_Data(0x10); // Gray Scale Level 11
- Write_Data(0x16); // Gray Scale Level 13
- Write_Data(0x1A); // Gray Scale Level 15
- Write_Data(0x1F); // Gray Scale Level 17
- Write_Data(0x24); // Gray Scale Level 19
- Write_Data(0x29); // Gray Scale Level 21
- Write_Data(0x2E); // Gray Scale Level 23
- Write_Data(0x33); // Gray Scale Level 25
- Write_Data(0x38); // Gray Scale Level 27
- Write_Data(0x3D); // Gray Scale Level 29
- Write_Data(0x42); // Gray Scale Level 31
- Write_Data(0x47); // Gray Scale Level 33
- Write_Data(0x4C); // Gray Scale Level 35
- Write_Data(0x51); // Gray Scale Level 37
- Write_Data(0x56); // Gray Scale Level 39
- Write_Data(0x5A); // Gray Scale Level 41
- Write_Data(0x5E); // Gray Scale Level 43
- Write_Data(0x62); // Gray Scale Level 45
- Write_Data(0x65); // Gray Scale Level 47
- Write_Data(0x68); // Gray Scale Level 49
- Write_Data(0x6B); // Gray Scale Level 51
- Write_Data(0x6E); // Gray Scale Level 53
- Write_Data(0x71); // Gray Scale Level 55
- Write_Data(0x74); // Gray Scale Level 57
- Write_Data(0x77); // Gray Scale Level 59
- Write_Data(0x7A); // Gray Scale Level 61
- Write_Data(0x7D); // Gray Scale Level 63
- }
- void Clear_Window(unsigned char a, unsigned char b, unsigned char c, unsigned char d)
- {
- Write_Command(0x8E);
- Write_Data(a); // Column Address of Start
- Write_Data(c); // Row Address of Start
- Write_Data(b); // Column Address of End
- Write_Data(d); // Row Address of End
- delay(10); // delay 5ms for its drawing
- }
- void OLED_InitIOs(void)
- {
- OLED_RES_1;
- OLED_CS_1;
- OLED_CLK_1;
- OLED_DIN_1;
- OLED_DC_1;
- }
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Initialization
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void OLED_Init(void)
- {
- unsigned char i;
- OLED_RES_0;
- for(i=0;i<200;i++)
- {
- delay(1); // delay
- }
- OLED_RES_1;
- // Display Off (0x00/0x01)
- Write_Command(0xAE);
- Write_Command(0xA0);
- Write_Data(0x74); // [0x74]: 64k Colors Mode; [0xB4]:262k Colors Mode;256 Colors Mode (0x34)
- Write_Command(0xA1);
- Write_Data(0x00);
- Write_Command(0xA2);
- Write_Data(0x80);
- Write_Command(0xA6);
- Write_Command(0xAD);
- Write_Data(0x8E);
- Write_Command(0xB0);
- Write_Data(0x05);
- Write_Command(0xB1);
- Write_Data(0x11);
- Write_Command(0xB3);
- Write_Data(0xF0);
- // gray table
- Set_Gray_Scale_Table();
- Write_Command(0xBB);
- Write_Data(0x1C);
- Write_Data(0x1C);
- Write_Data(0x1C);
- Write_Command(0xBE);
- Write_Data(0x3F);
- Write_Command(0xC1);
- Write_Data(0xDC);
- Write_Data(0xD2);
- Write_Data(0xFF);
- Write_Command(0xC7);
- Write_Data(0x0A);
- Write_Command(0xCA);
- Write_Data(0x7F);
- Write_Command(0xAF);
- }
- void EnableFill(unsigned char d)
- {
- Write_Command(0x92);
- Write_Data(!!d); // Default => 0x00
- }
- //===============================================================================//
- // Graphic Acceleration(by hardware)
- //===============================================================================//
- void Draw_Line64k(unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, unsigned short int col)
- {
- Write_Command(0x83);
- Write_Data(x1); // Column Address of Start
- Write_Data(y1); // Row Address of Start
- Write_Data(x2); // Column Address of End
- Write_Data(y2); // Row Address of End
- Write_Data(col>>8); // Line Color - CCCCCBBB
- Write_Data(col&0xff); // Line Color - BBBAAAAA
- delay(1); // delay 5ms for its drawing
- }
- void Draw_Rectangle64k(unsigned char xLeft, unsigned char yTop, unsigned char xRight, unsigned char yBottom, unsigned short int colOutline, unsigned short int colFill)
- {
- Write_Command(0x84);
- Write_Data(xLeft);
- Write_Data(yTop);
- Write_Data(xRight);
- Write_Data(yBottom);
- Write_Data(colOutline>>8); // Line Color - CCCCCBBB
- Write_Data(colOutline&0xff); // Line Color - BBBAAAAA
- Write_Data(colFill>>8); // Line Color - CCCCCBBB
- Write_Data(colFill&0xff); // Line Color - BBBAAAAA
- delay(2); // delay 5ms for its drawing
- }
- void Draw_Circle64k(unsigned char x, unsigned char y, unsigned char r, unsigned short int colOutline, unsigned short int colFill)
- {
- Write_Command(0x86);
- Write_Data(x); // Column Address of Start
- Write_Data(y); // Row Address of Start
- Write_Data(r); // Radius
- Write_Data(colOutline>>8); // Line Color - CCCCCBBB
- Write_Data(colOutline&0xff); // Line Color - BBBAAAAA
- Write_Data(colFill>>8); // Fill Color - CCCCCBBB
- Write_Data(colFill&0xff); // Fill Color - BBBAAAAA
- delay(2); // delay 10ms for its drawing
- }
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Show Regular Pattern (Partial or Full Screen)
- //
- // a: Column Address of Start
- // b: Column Address of End
- // c: Row Address of Start
- // d: Row Address of End
- // e: BBBBBGGG
- // f: GGGRRRRR
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void Fill_Block64k(unsigned char xLeft, unsigned char yTop, unsigned char xRight, unsigned char yBottom, unsigned short int col)
- {
- EnableFill(0x01);
- Draw_Rectangle64k(xLeft, yTop, xRight, yBottom, col, col);
- EnableFill(0x00);
- }
- void Fill_Block64k_Slow(unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, unsigned short int col)
- {
- unsigned char i,j;
- Set_Column_Address(x1,x2);
- Set_Row_Address(y1,y2);
- Set_Write_RAM();
- for(i=0;i<(y2-y1+1);i++)
- {
- for(j=0;j<(x2-x1+1);j++)
- {
- Write_Data(col>>8); // Line Color - CCCCCBBB
- Write_Data(col&0xff); // Line Color - BBBAAAAA
- }
- }
- }
- void Draw_Point64k_Slow(unsigned char x, unsigned char y, unsigned short int col)
- {
- Set_Column_Address(x,x);
- Set_Row_Address(y,y);
- Set_Write_RAM();
- Write_Data(col>>8); // Line Color - CCCCCBBB
- Write_Data(col&0xff); // Line Color - BBBAAAAA
- }
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Show Color Bar (Full Screen)
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void Rainbow(void)
- {
- // White => Column 1~16
- Fill_Block64k(0x00,0x00,0x0F,Max_Row,MAKECOLOR64k(0xFF,0xFF,0xFF));
- // Yellow => Column 17~32
- Fill_Block64k(0x10,0x00,0x1F,Max_Row,MAKECOLOR64k(0xFF,0xFF,0x00));
- // Purple => Column 33~48
- Fill_Block64k(0x20,0x00,0x2F,Max_Row,MAKECOLOR64k(0xFF,0x00,0xFF));
- // Cyan => Column 49~64
- Fill_Block64k(0x30,0x00,0x3F,Max_Row,MAKECOLOR64k(0x00,0xFF,0xFF));
- // Red => Column 65~80
- Fill_Block64k(0x40,0x00,0x4F,Max_Row,MAKECOLOR64k(0xFF,0x00,0x00));
- // Green => Column 81~96
- Fill_Block64k(0x50,0x00,0x5F,Max_Row,MAKECOLOR64k(0x00,0xFF,0x00));
- // Blue => Column 97~112
- Fill_Block64k(0x60,0x00,0x6F,Max_Row,MAKECOLOR64k(0x00,0x00,0xFF));
- // Black => Column 113~128
- Fill_Block64k(0x70,0x00,Max_Column,Max_Row,MAKECOLOR64k(0x00,0x00,0x00));
- }
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Instruction Setting
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void Set_Column_Address(unsigned char a, unsigned char b)
- {
- Write_Command(0x15);
- Write_Data(a); // Default => 0x00
- Write_Data(b); // Default => 0x83
- }
- void Set_Row_Address(unsigned char a, unsigned char b)
- {
- Write_Command(0x75);
- Write_Data(a); // Default => 0x00
- Write_Data(b); // Default => 0x83
- }
- void Set_Write_RAM(void)
- {
- Write_Command(0x5C); // Enable MCU to Write into RAM
- }
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- // Patterns
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- void Show_64k_Pattern_BigEndian(unsigned char *Data_Pointer, unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2)
- {
- unsigned char *Src_Pointer;
- unsigned char i,j;
- Src_Pointer=Data_Pointer;
- Set_Column_Address(x1,x2);
- Set_Row_Address(y1,y2);
- Set_Write_RAM();
- for(i=0;i<(y2-y1+1);i++)
- {
- for(j=0;j<(x2-x1+1);j++)
- {
- Write_Data(*Src_Pointer);
- Src_Pointer++;
- Write_Data(*Src_Pointer);
- Src_Pointer++;
- }
- }
- }
- void Show_64k_Pattern_LittleEndia(unsigned char *Data_Pointer, unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2)
- {
- unsigned char *Src_Pointer;
- unsigned char i,j;
- Src_Pointer=Data_Pointer;
- Set_Column_Address(x1,x2);
- Set_Row_Address(y1,y2);
- Set_Write_RAM();
- for(i=0;i<(y2-y1+1);i++)
- {
- for(j=0;j<(x2-x1+1);j++)
- {
- Write_Data(*(Src_Pointer+1));
- Write_Data(*(Src_Pointer));
- Src_Pointer+=2;
- }
- }
- }
- void Show_256k_Pattern(unsigned char *Data_Pointer, unsigned char a, unsigned char b, unsigned char c, unsigned char d)
- {
- unsigned char *Src_Pointer;
- unsigned char i,j;
- Src_Pointer=Data_Pointer;
- Set_Column_Address(a,b);
- Set_Row_Address(c,d);
- Set_Write_RAM();
- for(i=0;i<(d-c+1);i++)
- {
- for(j=0;j<(b-a+1);j++)
- {
- Write_Data(*Src_Pointer);
- Src_Pointer++;
- Write_Data(*Src_Pointer);
- Src_Pointer++;
- Write_Data(*Src_Pointer);
- Src_Pointer++;
- }
- }
- }
- const unsigned char Icon24x24x64k[] ={
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0x7b,0xf7,0xd6,0xee,0x73,0xe6,0x52,0xe6,0x51,0xe6,0x93,0xe6,0xd6,0xee,0x7b,0xf7,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x18,0xef,0x30,0xde,
- 0x0e,0xe6,0x6f,0xee,0x8f,0xee,0xd0,0xf6,0xf0,0xf6,0x90,0xee,0x6f,0xee,0x0e,0xe6,
- 0x10,0xe6,0xf8,0xee,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xbd,0xff,0x52,0xe6,0x0e,0xe6,0xf1,0xf6,
- 0x50,0xff,0x2e,0xff,0x0c,0xff,0xec,0xfe,0xec,0xfe,0xec,0xfe,0x0d,0xff,0x10,0xff,
- 0xd0,0xf6,0x0d,0xe6,0x31,0xe6,0xbd,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0x9c,0xf7,0xef,0xdd,0x8f,0xee,0x2f,0xff,0xcb,0xfe,
- 0xa8,0xfe,0xc8,0xfe,0xa8,0xfe,0xa8,0xfe,0xa7,0xfe,0xa7,0xfe,0x87,0xfe,0x87,0xfe,
- 0x8a,0xfe,0xee,0xfe,0x4d,0xee,0xae,0xdd,0x9d,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xbd,0xff,0xef,0xdd,0x8e,0xf6,0x0c,0xff,0xa8,0xfe,0xa8,0xfe,
- 0xa9,0xfe,0xc8,0xfe,0xa9,0xfe,0xa8,0xfe,0xa8,0xfe,0xa8,0xfe,0x68,0xfe,0x67,0xfe,
-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0xff,0xff,
- 0xff,0xff,0xff,0xff,0x19,0xef,0x47,0xdd,0xc6,0xfd,0xa5,0xfd,0x64,0xf5,0x65,0xf5,
- 0x64,0xf5,0x43,0xfd,0x23,0xfd,0x23,0xfd,0x23,0xfd,0x03,0xfd,0x02,0xfd,0x03,0xf5,
- 0x03,0xf5,0x03,0xf5,0x23,0xfd,0x25,0xfd,0xe6,0xdc,0x18,0xef,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xb5,0xe6,0x26,0xd5,0xc7,0xf5,0x85,0xfd,0x44,0xf5,
- 0x24,0xf5,0x44,0xf5,0x23,0xf5,0x24,0xf5,0x23,0xf5,0x23,0xf5,0x03,0xf5,0xe3,0xf4,
- 0xe3,0xf4,0x45,0xfd,0x66,0xf5,0xe5,0xdc,0x95,0xee,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xb6,0xe6,0x49,0xdd,0x87,0xf5,0xa7,0xfd,
- 0x66,0xfd,0x24,0xf5,0x23,0xf5,0x23,0xf5,0x03,0xf5,0xe3,0xf4,0x04,0xf5,0x46,0xfd,
- 0x67,0xfd,0x46,0xed,0x07,0xd5,0xb6,0xe6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x5a,0xf7,0xce,0xdd,0x27,0xdd,
- 0x47,0xed,0x67,0xf5,0x87,0xfd,0x67,0xfd,0x67,0xfd,0x87,0xfd,0x67,0xfd,0x46,0xed,
- 0x06,0xdd,0xad,0xdd,0x3a,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x19,0xef,
- 0x10,0xe6,0x6b,0xdd,0x49,0xe5,0x48,0xe5,0x28,0xe5,0x48,0xdd,0x6a,0xdd,0x10,0xe6,
- 0x18,0xef,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0x7c,0xf7,0x5a,0xf7,0x5a,0xef,0x7c,0xf7,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0x7c,0xf7,0x5a,0xf7,0x5a,0xef,0x7c,0xf7,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- };
- void draw_lines(void)
- {
- unsigned char x1,y1,x2,y2;
- unsigned short int i;
- // draw unfilled rectangles
- EnableFill(0x00);
- for (i=0; i<2000; i++) {
- x1=rand()%127;
- x2=rand()%127;
- y1=rand()%127;
- y2=rand()%127;
- Draw_Line64k(min(x1,x2),min(y1,y2),max(x1,x2),max(y1,y2), MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- void draw_rects(void)
- {
- unsigned char x1,y1,x2,y2;
- unsigned short int i;
- // draw unfilled rectangles
- EnableFill(0x00);
- for (i=0; i<2000; i++) {
- x1=rand()%127;
- x2=rand()%127;
- y1=rand()%127;
- y2=rand()%127;
- Draw_Rectangle64k(min(x1,x2),min(y1,y2),max(x1,x2),max(y1,y2), MAKECOLOR64k(rand(), rand(),rand()), 0x0000);
- }
- // draw filled rectangles
- EnableFill(0x01);
- for (i=0; i<2000; i++) {
- x1=rand()%127;
- x2=rand()%127;
- y1=rand()%127;
- y2=rand()%127;
- Draw_Rectangle64k(min(x1,x2),min(y1,y2),max(x1,x2),max(y1,y2), MAKECOLOR64k(rand(), rand(),rand()), MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- void draw_circles(void)
- {
- unsigned char x,y,r;
- unsigned short int i;
- // draw unfilled circles
- EnableFill(0x00);
- for (i=0; i<2000; i++) {
- x=rand()%128;
- y=rand()%128;
- r=rand()%60;
- Draw_Circle64k(x, y, r, MAKECOLOR64k(rand(), rand(),rand()), 0x0000);
- }
- // draw filled circles
- EnableFill(0x01);
- for (i=0; i<2000; i++) {
- x=rand()%128;
- y=rand()%128;
- r=rand()%60;
- Draw_Circle64k(x, y, r, MAKECOLOR64k(rand(), rand(),rand()), MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- void draw_wheels(void)
- {
- float al,pi=3.14159;
- unsigned char l=25, x,y,i;
- EnableFill(0x00);
- for (i=0; i<30; i++) {
- for (al=0; al<2*pi; al+=pi/24.0) {
- x=(unsigned char)(l*cos(al))+64;
- y=(unsigned char)(64-l*sin(al));
- Draw_Circle64k(x,y,25, MAKECOLOR64k(rand(), rand(),rand()), MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- }
- void draw_lines_flower1(void)
- {
- float pi=3.14159,al,f;
- unsigned char x1,y1,x2,y2, d=30;
- for(al=0.0; al<pi*2; al+=pi/360) {
- f=(d*(1.0+1.0/4.0*cos(12.0*al)))*(1.0+sin(4.0*al));
- x1=64+f*cos(al);
- x2=64+f*cos(al+pi/5.0);
- y1=64-f*sin(al);
- y2=64-f*sin(al+pi/5.0);
- Draw_Line64k(x1,y1,x2,y2, MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- void draw_lines_flower(void)
- {
- float pi=3.14159,al,f;
- unsigned char x1,y1,x2,y2, d=30;
- for(al=0.0; al<pi*2; al+=pi/360) {
- f=(d*(1.0+sin(4.0*al)));
- x1=64+f*cos(al);
- x2=64+f*cos(al+pi/5.0);
- y1=64-f*sin(al);
- y2=64-f*sin(al+pi/5.0);
- Draw_Line64k(x1,y1,x2,y2, MAKECOLOR64k(rand(), rand(),rand()));
- }
- }
- extern "C" {
- // 3D code from joaquim <[email protected]>
- typedef struct {
- double x, y, z;
- }
- Vector3D ;
- typedef struct {
- int x;
- int y;
- int z;
- }
- ScreenPoint;
- #define xAxis 64
- #define yAxis 64
- #define zAxis -350
- #define viewFov 80 // for big or small
- #define rotSpeed 5
- double thetaX = 0;
- #define FACENUMBER 72
- #define xCenter 64
- #define yCenter 64
- const uint16_t pontos[] = {
- 0, 0, 25,
- 60, 0, 25,
- 80, 80, 25,
- 160, 80, 25,
- 180, 0, 25,
- 240, 0, 25,
- 160,220, 25,
- 80,220, 25,
- 80,100, 25,
- 160,100, 25,
- 140,180, 25,
- 100,180, 25,
- 0, 0,-25,
- 60, 0,-25,
- 80, 80,-25,
- 160, 80,-25,
- 180, 0,-25,
- 240, 0,-25,
- 160,220,-25,
- 80,220,-25,
- 80,100,-25,
- 160,100,-25,
- 140,180,-25,
- 100,180,-25
- };
- const uint8_t face[ FACENUMBER ] = {
- 0,1, 1,2, 2,3, 3,4, 4,5, 5,6, 6,7, 7,0,
- 8,9, 9,10, 10,11, 11,8,
- 12,13, 13,14, 14,15, 15,16, 16,17, 17,18, 18,19, 19,12,
- 20,21, 21,22, 22,23, 23,20,
- 0,12, 1,13, 2,14, 3,15, 4,16, 5,17, 6,18, 7,19,
- 8,20, 9,21, 10,22, 11,23
- };
- const double _sin_tab[] = {
- 0.000000,0.017452,0.034899,0.052335,0.069756,0.087155,0.104528,0.121869,0.139173
- ,0.156434,0.173648,0.190808,0.207911,0.224951,0.241921,0.258819,0.275637,0.292371
- ,0.309016,0.325568,0.342020,0.358367,0.374606,0.390731,0.406736,0.422618,0.438371
- ,0.453990,0.469471,0.484809,0.499999,0.515038,0.529919,0.544639,0.559192,0.573576
- ,0.587785,0.601815,0.615661,0.629320,0.642787,0.656059,0.669130,0.681998,0.694658
- ,0.707106,0.719339,0.731353,0.743144,0.754709,0.766044,0.777145,0.788010,0.798635
- ,0.809016,0.819152,0.829037,0.838670,0.848048,0.857167,0.866025,0.874619,0.882947
- ,0.891006,0.898794,0.906307,0.913545,0.920504,0.927183,0.933580,0.939692,0.945518
- ,0.951056,0.956304,0.961261,0.965925,0.970295,0.974370,0.978147,0.981627,0.984807
- ,0.987688,0.990268,0.992546,0.994521,0.996194,0.997564,0.998629,0.999390,0.999847
- ,1.000000
- };
- double _sin( int angle ) {
- if ( angle >= 0 && angle <= 90 ) {
- return _sin_tab[angle];
- }
- else if ( angle >= 91 && angle <= 180 ) {
- return _sin_tab[90 - (angle - 90)];
- }
- else if ( angle >= 181 && angle <= 270 ) {
- return - _sin_tab[angle - 180];
- }
- else if ( angle >= 271 && angle <= 360 ) {
- return - _sin_tab[90 - (angle - 270)];
- }
- return 0;
- }
- double _cos( int angle ) {
- return _sin((angle+90)%360);
- }
- void Delay( int ms) {
- int i;
- while(ms--){
- i=2600; //empirically determined fudge factor 16mhz
- while(i--);
- }
- }
- /**
- * [(1 ,0 ,0),
- * (0 ,cos(a) ,-sin(a)),
- * (0 ,sin(a) ,cos(a))]
- * @param Vector3D
- * @param theta
- */
- Vector3D rotateX(int x, int y, int z, int theta) {
- Vector3D newv;
- newv.x = x;
- newv.y = y * _cos(theta) + z * -_sin(theta);
- newv.z = y * _sin(theta) + z * _cos(theta);
- return newv;
- }
- /**
- * [(cos(a) ,0 ,sin(a)),
- * (0 ,1 ,0),
- * (-sin(a),0 ,cos(a))]
- * @param Vector3D
- * @param theta
- */
- Vector3D rotateY(Vector3D vector, int theta) {
- Vector3D newv;
- newv.x = vector.x * _cos(theta) + vector.z * _sin(theta);
- newv.y = vector.y;
- newv.z = vector.x * -_sin(theta) + vector.z * _cos(theta);
- return newv;
- }
- /**
- * [(cos(a),-sin(a),0),
- * (sin(a),cos(a) ,0),
- * (0 ,0 ,1)]
- * @param Vector3D
- * @param theta
- */
- Vector3D rotateZ(Vector3D vector, int theta) {
- Vector3D newv;
- newv.x = vector.x * _cos(theta) + vector.y * -_sin(theta);
- newv.y = vector.x * _sin(theta) + vector.y * _cos(theta);
- newv.z = vector.z;
- return newv;
- }
- // -----------------------------------------------------------------------------
- ScreenPoint RotateFace( int faceNum, int angleX, int angleY, int angleZ ) {
- ScreenPoint screenPoint;
- Vector3D v3D;
- v3D = rotateX(pontos[(face[faceNum] * 3)] - xCenter, pontos[(face[faceNum] * 3) + 1] - yCenter, pontos[(face[faceNum] * 3) + 2], angleX);
- v3D = rotateY(v3D, angleY);
- v3D = rotateZ(v3D, angleZ);
- screenPoint.x = ((viewFov * v3D.x) / (v3D.z - zAxis)) + xAxis;
- screenPoint.y = ((viewFov * v3D.y) / (v3D.z - zAxis)) + yAxis;
- screenPoint.z = (int)v3D.z;
- return screenPoint;
- }
- void DrawScreen( void ) {
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- }
- void DrawClipLine(int xwmin,int ywmin,int xwmax,int ywmax, int x1,int y1,int x2,int y2, unsigned short int col);
- void DrawLine(int X1, int Y1, int X2, int Y2, uint16_t col) ;
- void DrawDemo( void ) {
- uint8_t x = 0;
- uint8_t x1,y1,x2,y2;
- ScreenPoint screenPointA, screenPointB;
- Clear_Window(0x00,0x83,0x00,0x83);
- // delay(10);
- thetaX = thetaX + rotSpeed;
- if (thetaX > 360) thetaX = 0;
- do {
- screenPointA = RotateFace( x, thetaX, thetaX, thetaX );
- x++;
- screenPointB = RotateFace( x, thetaX, thetaX, thetaX );
- x++;
- DrawClipLine(10,10,120,120,screenPointA.x,screenPointA.y,screenPointB.x,screenPointB.y, MAKECOLOR64k(rand(), rand(),rand()));
- //DrawLine(screenPointA.x,screenPointA.y,screenPointB.x,screenPointB.y, MAKECOLOR64k(rand(), rand(),rand()));
- }
- while ( x < FACENUMBER );
- delay(1);
- }
- static int clipTest(float p,float q,float *u1,float *u2)
- {
- int flag = 1;
- float r;
- if(p<0.0)
- {
- r=q/p;
- if(r>*u2)
- flag=0;
- else if(r>*u1)
- *u1=r;
- }
- else if(p>0.0)
- {
- r=q/p;
- if(r<*u1)
- flag=0;
- else if(r<*u2)
- *u2=r;
- }
- else if(q<0.0)
- flag=0;
- return(flag);
- }
- void DrawClipLine(int xwmin,int ywmin,int xwmax,int ywmax, int x1,int y1,int x2,int y2, unsigned short int col)
- {
- float u1=0.0,u2=1.0,dx=x2-x1,dy;
- if(clipTest(-dx,x1-xwmin,&u1,&u2))
- if(clipTest(dx,xwmax-x1,&u1,&u2))
- {
- dy=y2-y1;
- if(clipTest(-dy,y1-ywmin,&u1,&u2))
- if(clipTest(dy,ywmax-y1,&u1,&u2))
- {
- if(u2<1.0)
- {
- x2=x1+u2*dx;
- y2=y1+u2*dy;
- }
- if(u1>0.0)
- {
- x1=x1+u1*dx;
- y1=y1+u1*dy;
- }
- if (x1>x2 ||y1>y2)
- DrawLine(x1,y1,x2,y2,col);
- else
- Draw_Line64k(x1,y1,x2,y2, col);
- }
- }
- }
- #define DrawPoint Draw_Point64k_Slow
- /* Draw_line : algorithm by Jack Bresenham */
- void DrawLine(int X1, int Y1, int X2, int Y2, uint16_t col)
- {
- int dy;
- int dx;
- int StepX, StepY;
- int Fraction;
- dy = Y2 - Y1;
- dx = X2 - X1;
- if (dy < 0)
- {
- dy = -dy;
- StepY = -1;
- }
- else
- StepY = 1;
- if (dx < 0)
- {
- dx = -dx;
- StepX = -1;
- }
- else
- StepX = 1;
- dy <<= 1; // dy is now 2*dy
- dx <<= 1; // dx is now 2*dx
- DrawPoint( X1, Y1, col);
- if (dx > dy)
- {
- Fraction = dy - (dx >> 1); // same as 2*dy - dx
- while (X1 != X2)
- {
- if (Fraction >= 0)
- {
- Y1 += StepY;
- Fraction -= dx; // same as fraction -= 2*dx
- }
- X1 += StepX;
- Fraction += dy; // same as fraction -= 2*dy
- DrawPoint( X1, Y1, col);
- }
- }
- else
- {
- Fraction = dx - (dy >> 1);
- while (Y1 != Y2)
- {
- if (Fraction >= 0)
- {
- X1 += StepX;
- Fraction -= dy;
- }
- Y1 += StepY;
- Fraction += dx;
- DrawPoint( X1, Y1, col);
- }
- }
- }
- } //extern "C" {
- // -----------------------------------------------------------------------------
- void setup() {
- long i;
- // set the digital pin as output:
- pinMode(RST_PIN, OUTPUT);
- pinMode(CS_PIN, OUTPUT);
- pinMode(DC_PIN, OUTPUT);
- pinMode(DIN_PIN, OUTPUT);
- pinMode(CLK_PIN, OUTPUT);
- pinMode(HVEN_PIN, OUTPUT);
- OLED_HVEN_1; //+12V on
- OLED_InitIOs();
- OLED_Init();
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- while(1)
- {
- DrawDemo();
- }
- draw_lines();
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- draw_rects();
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- draw_circles();
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- draw_wheels();
- // do filling color
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0x00,0x00,0x00));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0xFF,0x00,0x00));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0x00,0xFF,0x00));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0x00,0x00,0xFF));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0xFF,0xFF,0x00));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0x00,0xFF,0xFF));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0xFF,0x00,0xFF));
- delay(500);
- Fill_Block64k(0x00,0x00,Max_Column,Max_Row,MAKECOLOR64k(0xFF,0xFF,0xFF));
- delay(500);
- Clear_Window(0x00,0x83,0x00,0x83);
- delay(10);
- Rainbow();
- delay(500);
- // show icon
- Show_64k_Pattern_LittleEndia((unsigned char *)Icon24x24x64k,50,50,50+23,50+23);
- }
- // do put code in loop func
- void loop()
- {
- while(1)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment