fork download
  1. #include <stdlib.h>
  2. #include <avr/io.h>
  3. #include <avr/pgmspace.h>
  4. #include <util/delay.h>
  5. #include "lcd.h"
  6.  
  7. int main(void){
  8. int y = 0;
  9. static const unsigned char customChar[8][8] = {
  10. {
  11. 0x0F,
  12. 0x10,
  13. 0x0A,
  14. 0x0F,
  15. 0x0A,
  16. 0x08,
  17. 0x10,
  18. 0x0F
  19. },
  20. {
  21. 0x18,
  22. 0x17,
  23. 0x0D,
  24. 0x11,
  25. 0x11,
  26. 0x0D,
  27. 0x17,
  28. 0x18
  29. },
  30. {
  31. 0x07,
  32. 0x08,
  33. 0x12,
  34. 0x0E,
  35. 0x0E,
  36. 0x12,
  37. 0x08,
  38. 0x07
  39. },
  40. {
  41. 0x18,
  42. 0x17,
  43. 0x0D,
  44. 0x11,
  45. 0x11,
  46. 0x0D,
  47. 0x17,
  48. 0x18
  49. },
  50. {
  51. 0x06,
  52. 0x09,
  53. 0x12,
  54. 0x09,
  55. 0x09,
  56. 0x12,
  57. 0x09,
  58. 0x06
  59. },
  60. {
  61. 0x19,
  62. 0x16,
  63. 0x0D,
  64. 0x16,
  65. 0x16,
  66. 0x0D,
  67. 0x16,
  68. 0x19
  69. },
  70. {
  71. 0x0C,
  72. 0x0C,
  73. 0x0F,
  74. 0x18,
  75. 0x18,
  76. 0x08,
  77. 0x0C,
  78. 0x13
  79. },
  80. {
  81. 0x13,
  82. 0x13,
  83. 0x10,
  84. 0x07,
  85. 0x07,
  86. 0x17,
  87. 0x16,
  88. 0x0C
  89. }
  90. };
  91.  
  92. lcd_init(LCD_DISP_ON);
  93. lcd_clrscr();
  94.  
  95. lcd_command(_BV(LCD_CGRAM)); /* set CG RAM start address 0 */
  96. for(int i = 0; i < 8; i++){
  97. for(int j = 0; j < 8; j++){
  98. lcd_data(customChar[i][j]);
  99. }
  100. }
  101.  
  102. for(;;){
  103. for(int i = 0; i < 8; i++){
  104. lcd_gotoxy(i, y);
  105. lcd_putc(i);
  106. _delay_ms(500);
  107. }
  108. lcd_clrscr();
  109. }
  110. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:20: fatal error: avr/io.h: No such file or directory
 #include <avr/io.h>
                    ^
compilation terminated.
stdout
Standard output is empty