-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay_zigzag.c
executable file
·153 lines (153 loc) · 3.32 KB
/
display_zigzag.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
///*
// * main.c
// */
//
//#include <stdio.h>
//#include "usbstk5515.h"
//#include "usbstk5515_i2c.h"
//#include "lcd.h"
//#include "oled.h"
//#include "usbstk5515_gpio.h"
//
//#define OSD9616_I2C_ADDR 0x3C // OSD9616 I2C address
//
//Uint8 top [128];
//Uint8 bottom [128];
//
//void main(void)
//{
// Uint16 i;
//
// USBSTK5515_init();//Initializing the Processer
// oled_init();
//
// //Making the zig-zag -- 10.1.3 Set Memory Addressing Mode (page addressing mode: 128 x 8)
// for(i = 0; i<16; i++)
// {
// if(i<8)
// {
// top[i] = 0x01 << i;
// bottom[i] = 0;
// }
// else
// {
// top[i] = 0;
// bottom[i] = 0x01 << (i-8);
// }
// }
// for(i = 16; i<32; i++)
// {
// if(i<24)
// {
// top[i] = 0;
// bottom[i] = 0x80 >> (i-16);
// }
// else
// {
// top[i] = 0x80 >> (i-24);
// bottom[i] = 0;
// }
// }
// for(i=32; i<48; i++)
// {
// if(i<40)
// {
// top[i] = 0x01 << (i-32);
// bottom[i] = 0;
// }
// else
// {
// top[i] = 0;
// bottom[i] = 0x01 << (i-40);
// }
// }
// for(i=48; i<64; i++)
// {
// if(i<56)
// {
// top[i] = 0;
// bottom[i] = 0x80 >> (i-48);
// }
// else
// {
// top[i] = 0x80 >> (i-56);
// bottom[i] = 0;
// }
// }
//
// for(i = 0; i<16; i++)
// {
// if(i<8)
// {
// top[i + 64] = 0x01 << i;
// bottom[i + 64] = 0;
// }
// else
// {
// top[i + 64] = 0;
// bottom[i + 64] = 0x01 << (i-8);
// }
// }
// for(i = 16; i<32; i++)
// {
// if(i<24)
// {
// top[i + 64] = 0;
// bottom[i + 64] = 0x80 >> (i-16);
// }
// else
// {
// top[i + 64] = 0x80 >> (i-24);
// bottom[i + 64] = 0;
// }
// }
// for(i=32; i<48; i++)
// {
// if(i<40)
// {
// top[i + 64] = 0x01 << (i-32);
// bottom[i + 64] = 0;
// }
// else
// {
// top[i + 64] = 0;
// bottom[i + 64] = 0x01 << (i-40);
// }
// }
// for(i=48; i<64; i++)
// {
// if(i<56)
// {
// top[i + 64] = 0;
// bottom[i + 64] = 0x80 >> (i-48);
// }
// else
// {
// top[i + 64] = 0x80 >> (i-56);
// bottom[i + 64] = 0;
// }
// }
// //Done makeing the zig-zag
// printf("Here we go\n");
//
// OSD9616_send(0x00,0xb0); // Set page for page pointer to page 0
// for(i=0; i<128; i++)
// {
// OSD9616_send(0x40, top[i]); //Writes the top page
// }
//
// OSD9616_send(0x00,0xb0+1); // Set page for page pointer to page 1
//
// for(i=0; i<128; i++)
// {
// OSD9616_send(0x40, bottom[i]);//Writes the bottom page
// }
//}
//
// /** The code includes several header files, including stdio.h, and some specific to the USBSTK5515 development kit, I2C communication, LCD, OLED, and GPIO.
// * The main function is the entry point of the program.
// * It initializes the USBSTK5515 processor and the OLED display using USBSTK5515_init() and oled_init().
// * The code then defines two arrays, top and bottom, each of size 128. These arrays appear to be used to create a zig-zag pattern that will be displayed on the OLED screen.
// * Several loops fill the top and bottom arrays with values to create the zig-zag pattern.
// * The code sends data to the OLED display using the OSD9616_send function. It sets the page pointer to page 0 and page 1 (likely corresponding to the top and bottom halves of the display), and then it sends the data from the top and bottom arrays to the display.
// * Finally, the code prints "Here we go" to the standard output (likely a console) using printf. **/