#include <LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(9,8,7,6,5,4);
uint8_t diamand [8] =
{
0b00100,
0b01010,
0b10001,
0b10001,
0b10001,
0b01010,
0b00100,
0b00000,
};
byte sunShine[8] =
{
0b00100,
0b01010,
0b10001,
0b10001,
0b10001,
0b01010,
0b00100,
0b00000,
};
byte surS = 0, surR = 0;
byte surSss = 0, surRss = 0;
bool test1 = true,test2 = true,test3 = true,test4 = true;
int skore = 0;
void setup()
{
lcd.createChar(1, diamand);
lcd.createChar(2, sunShine);
lcd.begin(20,4);
pinMode(A0, INPUT);
digitalWrite(A0, HIGH);
pinMode(A1, INPUT);
digitalWrite(A1, HIGH);
pinMode(A2, INPUT);
digitalWrite(A2, HIGH);
pinMode(A3, INPUT);
digitalWrite(A3, HIGH);
lcd.setCursor(surS,surR);
lcd.print("\x01");
randomSeed(analogRead(A4));
surSss = random(0,20);
surRss = random(0,4);
lcd.setCursor(surSss,surRss);
lcd.print("\x02");
}
void loop()
{
if(digitalRead(A0) == LOW && test1 == true)
{
test1 = false;
lcd.setCursor(surS,surR);
lcd.print(" ");
if(surS>0)
surS--;
lcd.clear();
lcd.setCursor(surS,surR);
lcd.print("\x01");
}
else if(digitalRead(A0) != LOW && test1 != true)
{
test1 = true;
}
if(digitalRead(A2) == LOW && test2 == true)
if(surS == surSss && surR == surRss)
{
surSss = random(0,20);
surRss = random(0,4);
lcd.setCursor(surSss,surRss);
lcd.print("\x02");
}
}
else if
{
test = true
}
if(digitalRead(A0) == LOW && test1 == true)
}