Design Nui for Rapberry PI Touch Display with Kivy [Arch linux]

Posted by:

Preamble

Kivy (from official site)- Open source Python library for rapid development of applications that make use of innovative natural user interfaces (NUI), such as multi-touch apps.

CLI-GUI-NUI.png

Kivy Installation and Some Forplay

Following is mainly taken from Richardson Git link and modified for Arch Linux.

  1. Installation It takes quite a while for Raspberry PI since it takes quite a few dependencies. As said by Kivy: “We try not to reinvent the wheel, but to bring something innovative to the market. As a consequence, we’re focused on our own code and use pre-existing, high-quality third-party libraries where possible. To support the full, rich set of features that Kivy offers, several other libraries are required.” So… be patient…

  2. Launch the multi touch pictures demo. This will initialize the config.ini.

  3. Type Control+C to exit the pictures demo.
  4. To enable touch, you’ll need to make a modification to the Kivy configuration file:

    Go into the [input] section, remove the lines that are in there and put in:

  5. Launch the UI showcase. This shows you all the different UI elements that Kivy makes available to you:

    If you’d like, explore the other examples in ~/kivy/examples/.

Try Kivy and GPIO together

  1. download this repo to your Raspberry Pi if you haven’t already:

  2. The example uses BCM GPIO pins 17 as a piezo buzzer, 27 and 10 as LEDs, and 22 as a button. Here is a Simple Guide to the RPi GPIO Header and Pins. In my case, I am using a tri-color LED for this demo: 27 red, 10 Green, 17 Blue, and 22 direct ground.
  3. First try to run the example as root (root access is required for the GPIO library):

  4. As you’ll see, touch doesn’t work. To fix this, you need to make the same change to config.ini you made before, but to the root account’s config file. Exit Control+C and copy over your home directory’s Kivy configuration file to overwrite the root account’s:

  5. The demo video at Youtube -taken with iPhone 6S -is pretty impressive.

0
  Related Posts

Add a Comment