Kivy on Raspberry

  • 2017-07-12
  • 23
  • 0
  • 0
  1. Install the dependencies:

    sudo apt-get update sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \ pkg-config libgl1-mesa-dev libgles2-mesa-dev \ python-setuptools libgstreamer1.0-dev git-core \ gstreamer1.0-plugins-{bad,base,good,ugly} \ gstreamer1.0-{omx,alsa} python-dev libmtdev-dev \ xclip 

  2. Install a new enough version of Cython:

    sudo pip install -I Cython==0.23 

  3. Install Kivy globally on your system:

    sudo pip install git+https://github.com/kivy/kivy.git@master


别忘了:

Change the default screen to use

You can set an environment variable named KIVY_BCM_DISPMANX_ID in order to change the display used to run Kivy. For example, to force the display to be HDMI, use:

KIVY_BCM_DISPMANX_ID=2 python main.py 

Check Controlling the environment to see all the possible values.

Using Official RPi touch display

If you are using the official Raspberry Pi touch display, you need to configure Kivy to use it as an input source. To do this, edit the file~/.kivy/config.ini and go to the [input] section. Add this:

mouse = mouse mtdev_%(name)s = probesysfs,provider=mtdev hid_%(name)s = probesysfs,provider=hidinput


评论

如果没有评论就会看到我(不要戳我)

有何高论