Blame view

RIOT/tests/driver_hd44780/main.c 1.28 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  /*
   * Copyright (C) 2017 HAW Hamburg
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @ingroup     tests
   * @{
   *
   * @file
   * @brief       Test application for Arduino LCM1602C LCD
   *
   * @author      Sebastian Meiling <s@mlng.net>
   *
   * @}
   */
  
  #include <stdio.h>
  
  #include "xtimer.h"
  #include "hd44780.h"
  #include "hd44780_params.h"
  
  int main(void)
  {
      hd44780_t dev;
      /* init display */
      puts("[START]");
      if (hd44780_init(&dev, &hd44780_params[0]) != 0) {
          puts("[FAILED]");
          return 1;
      }
      /* clear screen, reset cursor */
      hd44780_clear(&dev);
      hd44780_home(&dev);
      /* write first line */
      hd44780_print(&dev, "Hello World ...");
      xtimer_sleep(1);
      /* set cursor to second line and write */
      hd44780_set_cursor(&dev, 0, 1);
      hd44780_print(&dev, "   RIOT is here!");
      xtimer_sleep(3);
      /* clear screen, reset cursor */
      hd44780_clear(&dev);
      hd44780_home(&dev);
      /* write first line */
      hd44780_print(&dev, "The friendly IoT");
      /* set cursor to second line and write */
      hd44780_set_cursor(&dev, 0, 1);
      hd44780_print(&dev, "Operating System");
  
      puts("[SUCCESS]");
  
      return 0;
  }