fork download
  1. #include <time.h>
  2. #include <LiquidCrystal.h>
  3.  
  4. LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
  5.  
  6. uint8_t dir = 1, col = 0, lin = 0;
  7. byte customChar[8] = {0};
  8. int8_t memOffset = 0;
  9.  
  10. void CreatePrintCustomChars(){
  11. for(uint8_t j = 0; j < 8; j++){
  12. for(uint8_t i = 0; i < 8; i++)
  13. customChar[i] = rand() % 32;
  14. lcd.createChar(memOffset++, customChar);
  15. lcd.write(uint8_t(memOffset));
  16. }
  17. }
  18.  
  19. void setup(){
  20. srand(time(NULL));
  21. Serial.begin(9600);
  22.  
  23. lcd.begin(20, 4);
  24. lcd.setCursor(lin, col);
  25. }
  26.  
  27. void loop(){
  28.  
  29. for(uint8_t i = 0; i < 80; i++){
  30. lcd.setCursor(lin, col);
  31. CreatePrintCustomChars();
  32. if(col == 19){
  33. col = 0;
  34. lin = (lin + 1) % 4;
  35. }else
  36. col++;
  37.  
  38. if(dir)
  39. memOffset += 1;
  40. else
  41. memOffset -= 1;
  42.  
  43. if (memOffset < 0) {
  44. dir ^= 1;
  45. memOffset = 1;
  46. }else if (memOffset > 7) {
  47. dir ^= 1;
  48. memOffset = 6;
  49. }
  50.  
  51. delay(100);
  52. }
  53. }
  54.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:27: fatal error: LiquidCrystal.h: No such file or directory
compilation terminated.
stdout
Standard output is empty