Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // include the library code:
- #include <LiquidCrystal.h>
- // initialize the library by associating any needed LCD interface pin
- // with the arduino pin number it is connected to
- LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
- // make some custom characters:
- byte cock[8] = {
- 0b00100,
- 0b01110,
- 0b01010,
- 0b01010,
- 0b01010,
- 0b10001,
- 0b10101,
- 0b01010
- };
- byte eggs[8] = {
- 0b01110,
- 0b10001,
- 0b10000,
- 0b01000,
- 0b10000,
- 0b10001,
- 0b01110,
- 0b00000
- };
- byte dickhead[8] = {
- 0b00000,
- 0b11110,
- 0b00001,
- 0b00011,
- 0b00001,
- 0b11110,
- 0b00000,
- 0b00000
- };
- // pinus
- void drawpinus(int pinus_length)
- {
- lcd.write(1);
- for (int i = 0; i< pinus_length; i++)
- {
- lcd.print("=");
- }
- lcd.write(2);
- lcd.print(" ");
- }
- void setup() {
- // set up the LCD's number of columns and rows:
- lcd.begin(16, 2);
- // custom chars
- lcd.createChar(0, cock);
- lcd.createChar(1, eggs);
- lcd.createChar(2, dickhead);
- }
- void loop() {
- // page 1 (it works)
- lcd.setCursor(0, 0);
- lcd.print("E6ATb! PA6OTAET!");
- lcd.setCursor(0, 1);
- lcd.write((byte)0);
- lcd.write((byte)0);
- lcd.write((byte)0);
- lcd.print(" Xyu!Xyu! ");
- lcd.write((byte)0);
- lcd.write((byte)0);
- lcd.write((byte)0);
- delay(2000);
- // page 2 (o,rly)
- lcd.setCursor(0, 0);
- lcd.print("*** OXyETb ***");
- lcd.setCursor(4, 1);
- drawpinus(6);
- delay(2000);
- // page 3 (the pinuses)
- lcd.setCursor(0, 0);
- lcd.print(" ");
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- lcd.setCursor(0, 1);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- drawpinus(3);
- delay(1000);
- // pinuses fly right
- for (int i = 0; i < 80; i++)
- {
- lcd.scrollDisplayRight();
- delay(250);
- }
- delay(2000);
- // page 4 (uptime)
- lcd.setCursor(0, 0);
- lcd.print(millis() / 1000);
- lcd.print(" seconds ");
- lcd.setCursor(0, 1);
- lcd.print(millis() / 60000);
- lcd.print(" minutes ");
- delay(3000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement