Created
May 10, 2023 06:38
-
-
Save kachurovskiy/c44a5886c0aa95e7cf9cbbf71869476e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Wire.h> | |
#include <LiquidCrystal.h> | |
LiquidCrystal lcd(21, 48, 47, 38, 39, 40, 41, 42, 2, 1); | |
void setup() { | |
lcd.begin(20, 4); | |
lcd.setCursor(0, 3); | |
} | |
int col = 0; | |
int row = 0; | |
int ch = 0; | |
void loop() { | |
lcd.setCursor(col, row); | |
lcd.print(" "); | |
lcd.setCursor(col, row); | |
lcd.print(char(ch)); | |
if (col < 19) { | |
col++; | |
} else if (row < 3) { | |
col = 0; | |
row++; | |
} else { | |
row = 0; | |
col = 0; | |
} | |
ch = (ch + 1) % 256; | |
delay(100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment