Guest User

Untitled

a guest
Apr 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. //#include <time.h>
  4.  
  5. int darkPixel = 1;
  6. int lightPixel = 0;
  7.  
  8. int display[64][128];
  9.  
  10. struct _Letter{
  11.     char character;
  12.     int width;
  13.     int charData[8][5];
  14. };
  15.  
  16. typedef struct _Letter Letter;
  17.  
  18.  
  19.  
  20. Letter *allocLetter(void)
  21. {
  22.     /* Pointer to a list object */
  23.     Letter *letter;
  24.  
  25.     /* Allocate memory for a list object */
  26.     letter = (Letter*) malloc(1 * sizeof(Letter));
  27.     int arr[8][5];
  28.     letter->character = NULL;
  29.     letter->charData = *arr;
  30.     letter->width = NULL;
  31.  
  32.     return letter;
  33. }
  34. void printArray(void) {
  35.     int i = 0;
  36.     int j = 0;
  37.  
  38.     for(i = 0; i < 64; i++) {
  39.         for(j = 0; j < 64; j++) {
  40.             printf("%d",display[i][j]);
  41.         }
  42.         printf("\n");
  43.     }  
  44. }
  45.  
  46. void setPixel(int x, int y, int val) {
  47.     display[y][x] = val;
  48. }
  49.  
  50.  
  51.  
  52. int main(void)
  53. {
  54.     //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};
  55.  
  56.     int arr[8][5] =
  57.     {
  58.         0,0,0,0,0,
  59.         1,0,0,0,0,
  60.         1,0,0,0,0,
  61.         1,0,0,0,0,
  62.         1,0,0,0,0,
  63.         1,0,0,0,0,
  64.         1,0,0,0,0,
  65.         1,0,0,0,0
  66.     };
  67.    
  68.     Letter letter = *allocLetter();
  69.     letter.character = '1';
  70.  
  71.     //
  72.  
  73.     //int i = 0;
  74.     //int j = 0;
  75.  
  76.     //for(i = 0; i < 8; i++) {
  77.     //  for(j = 0; j < 5; j++) {
  78.     //      printf("%d",arr[i][j]);
  79.     //  }
  80.     //  printf("\n");
  81.     //}
  82. /*
  83.     setPixel(0,0,darkPixel);
  84.     setPixel(0,1,darkPixel);
  85.     printArray();
  86. */
  87.     return(0);
  88. }
Add Comment
Please, Sign In to add comment