#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
int tlen = strlen(mess);
int direction = 0;
int tasterPin = 2;
voidsetup()
{
lcd.begin(16,2);
lcd.println("ISKRA")
attachInterrupt(digitalPinToInterrupt(tasterPin),tasterISR,FALLING);
cli();
TCCR1A=0;
TCCR1B=0;
tctn1 = 3036;
TCNT1 |= (1 << CS12);
TIMSK1 |= (1 << TOIE1);
}
void toright()
{
lcd.setCursor(0, 1);
for(i = 0; i < tlen; i++)
{
lcd.print(mess[i]);
}
char swaq = mess[tlen-1];
for (i = tlen-1; i >=1; i--)
{
mess[i] = mess[i-1];
}
mess[0] = swaq;
}
void toleft()
{
lcd.setCursor(0, 1);
for(i = 0; i < tlen; i++)
{
lcd.print(mess[i]);
}
char swaq = mess[0];
for (i = 0; i <tlen; i++)
{
mess[i] = mess[i+1];
}
mess[tlen-1] = swaq;
}
voidloop() {
if (direction == 0)
{
lcd.setCursor(0, 0);
lcd.print("-->");
toright();
}
else
{
lcd.setCursor(0, 0);
lcd.print("<--");
toleft();
}
}