Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal_I2C.h>
- LiquidCrystal_I2C lcd(0x27,16,2);
- int row = 0;
- void setup() {
- // put your setup code here, to run once:
- lcd.init();
- lcd.backlight();
- lcd.cursor();
- }
- void loop() {
- // put your main code here, to run repeatedly:
- for(int i = 0; i<16; i++)
- {
- if(digitalRead(2) == 1)
- {
- row = 1;
- }else{
- row = 0;
- }
- func(i,row);
- }
- }
- void func(int i, int row)
- {
- lcd.setCursor(i,row);
- lcd.print("*");
- delay(400);
- lcd.clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement