// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
// set up a constant for the tilt switch pin
const int switchPin = 6;
// variable to hold the value of the switch pin
int switchState = 0;
// variable to hold previous value of the switch pin
int prevSwitchState = 0;
// a variable to choose which reply from the crystal ball
int reply;
void setup() {
// set up the number of columns and rows on the LCD
lcd.begin(16, 2);
// set up the switch pin as an input
pinMode(switchPin, INPUT);
// Print a message to the LCD.
lcd.print("Tiny");
// set the cursor to column 0, line 1
// line 1 is the second row, since counting begins with 0
lcd.setCursor(0, 1);
// print to the second line
lcd.print("Cinema!");
}
void loop() {
if (switchState == LOW)
{
lcd.clear();
lcd.print("^('^')^");
lcd.setCursor(0, 1);
lcd.print(" ( )");
delay(1000);
lcd.clear();
lcd.print("/(-_-)>");
lcd.setCursor(0, 1);
lcd.print(" / |");
delay(1000);
}
}