Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- //#include <time.h>
- int darkPixel = 1;
- int lightPixel = 0;
- int display[64][128];
- struct _Letter{
- char character;
- int width;
- int charData[8][5];
- };
- typedef struct _Letter Letter;
- Letter *allocLetter(void)
- {
- /* Pointer to a list object */
- Letter *letter;
- /* Allocate memory for a list object */
- letter = (Letter*) malloc(1 * sizeof(Letter));
- int arr[8][5];
- letter->character = NULL;
- letter->charData = *arr;
- letter->width = NULL;
- return letter;
- }
- void printArray(void) {
- int i = 0;
- int j = 0;
- for(i = 0; i < 64; i++) {
- for(j = 0; j < 64; j++) {
- printf("%d",display[i][j]);
- }
- printf("\n");
- }
- }
- void setPixel(int x, int y, int val) {
- display[y][x] = val;
- }
- int main(void)
- {
- //letter.charData = {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0};
- int arr[8][5] =
- {
- 0,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0,
- 1,0,0,0,0
- };
- Letter letter = *allocLetter();
- letter.character = '1';
- //
- //int i = 0;
- //int j = 0;
- //for(i = 0; i < 8; i++) {
- // for(j = 0; j < 5; j++) {
- // printf("%d",arr[i][j]);
- // }
- // printf("\n");
- //}
- /*
- setPixel(0,0,darkPixel);
- setPixel(0,1,darkPixel);
- printArray();
- */
- return(0);
- }
Add Comment
Please, Sign In to add comment