Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 16th, 2014  |  syntax: None  |  size: 2.68 KB  |  views: 20,248  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*
  2.  
  3. Dragonkeepers:
  4. 16x2
  5. FootPrints ScreenSaver / Loading Screen
  6.  
  7. */
  8.  
  9. #include <LiquidCrystal.h>
  10.  
  11. LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
  12.  
  13. byte footp1[8] = {
  14.   0b00000,
  15.   0b00000,
  16.   0b00111,
  17.   0b01000,
  18.   0b10000,
  19.   0b10000,
  20.   0b01000,
  21.   0b00111
  22. };
  23.  
  24. byte footp2[8] = {
  25.   0b00000,
  26.   0b00001,
  27.   0b11110,
  28.   0b10000,
  29.   0b10000,
  30.   0b10000,
  31.   0b10000,
  32.   0b11111
  33. };
  34.  
  35. byte footp3[8] = {
  36.   0b11110,
  37.   0b00000,
  38.   0b00000,
  39.   0b00000,
  40.   0b00000,
  41.   0b00001,
  42.   0b00010,
  43.   0b11000
  44. };
  45.  
  46. byte footp4[8] = {
  47.   0b00000,
  48.   0b10000,
  49.   0b01000,
  50.   0b01000,
  51.   0b10000,
  52.   0b00000,
  53.   0b00000,
  54.   0b00000
  55. };
  56.  
  57. byte footrv1[8] = {
  58.   0b00111,
  59.   0b01000,
  60.   0b10000,
  61.   0b10000,
  62.   0b01000,
  63.   0b00111,
  64.   0b00000,
  65.   0b00000
  66. };
  67.  
  68. byte footrv2[8] = {
  69.   0b11111,
  70.   0b10000,
  71.   0b10000,
  72.   0b10000,
  73.   0b10000,
  74.   0b11110,
  75.   0b00001,
  76.   0b00000,
  77. };
  78. byte footrv3[8] = {
  79.   0b11000,
  80.   0b00010,
  81.   0b00001,
  82.   0b00000,
  83.   0b00000,
  84.   0b00000,
  85.   0b00000,
  86.   0b11110
  87. };
  88.  
  89. byte footrv4[8] = {
  90.   0b00000,
  91.   0b00000,
  92.   0b00000,
  93.   0b10000,
  94.   0b01000,
  95.   0b01000,
  96.   0b10000,
  97.   0b00000
  98. };
  99. void setup() {
  100.   lcd.createChar(1, footp1);
  101.   lcd.createChar(2, footp2);
  102.   lcd.createChar(3, footp3);
  103.   lcd.createChar(4, footp4);
  104.   lcd.createChar(5, footrv1);
  105.   lcd.createChar(6, footrv2);  
  106.   lcd.createChar(7, footrv3);
  107.   lcd.createChar(8, footrv4);
  108.   lcd.begin(16, 2);
  109. }
  110.  
  111. void loop() {
  112.   int sensorReading = analogRead(A0);
  113.   int delayTime = 1000; /*map(sensorReading, 0, 1023, 200, 1000);*/
  114.   lcd.setCursor(0, 0);
  115.   lcd.write(5);
  116.   lcd.write(6);
  117.   lcd.write(7);
  118.   lcd.write(8);
  119.   delay(delayTime);
  120.   lcd.setCursor(3, 1);
  121.   lcd.write(1);
  122.   lcd.write(2);
  123.   lcd.write(3);
  124.   lcd.write(4);
  125.   delay(delayTime);
  126.  
  127.   lcd.setCursor(6, 0);
  128.   lcd.write(5);
  129.   lcd.write(6);
  130.   lcd.write(7);
  131.   lcd.write(8);
  132.   delay(delayTime);
  133.   lcd.setCursor(9, 1);
  134.   lcd.write(1);
  135.   lcd.write(2);
  136.   lcd.write(3);
  137.   lcd.write(4);
  138.   delay(delayTime);
  139.  
  140.   lcd.setCursor(12, 0);
  141.   lcd.write(5);
  142.   lcd.write(6);
  143.   lcd.write(7);
  144.   lcd.write(8);
  145.   delay(delayTime);
  146.   lcd.setCursor(15, 1);
  147.   lcd.write(1);
  148.   delay(delayTime);
  149.  
  150.   lcd.clear();
  151.  
  152.   lcd.setCursor(0, 1);
  153.   lcd.write(2);
  154.   lcd.write(3);
  155.   lcd.write(4);
  156.   delay(delayTime);
  157.   lcd.setCursor(3, 0);
  158.   lcd.write(5);
  159.   lcd.write(6);
  160.   lcd.write(7);
  161.   lcd.write(8);
  162.   delay(delayTime);
  163.  
  164.   lcd.setCursor(6, 1);
  165.   lcd.write(1);
  166.   lcd.write(2);
  167.   lcd.write(3);
  168.   lcd.write(4);
  169.   delay(delayTime);
  170.  
  171.   lcd.write(6);
  172.   lcd.write(7);
  173.   lcd.write(8);
  174.   delay(delayTime);
  175.  
  176.   lcd.setCursor(12, 1);
  177.   lcd.write(1);
  178.   lcd.write(2);
  179.   lcd.write(3);
  180.   lcd.write(4);
  181.   delay(delayTime);
  182.  
  183.   lcd.clear();
  184. }
clone this paste RAW Paste Data