Python module to use GPIOs

Hello guys!

I have tested GPIO in small boards like C.H.I.P, Raspberry Pi and Orange Pi with python.

Is there any python module for controlling GPIOs in LicheePi Zero?

Note: I have found a link on other post but I get a 404 Error :frowning:

Here you have the image for the link:

Regards.

This could be a starting place:

@combs thank you very much for your reply!

Can it be used on the LicheePi Zero as is? Or does it need to be change somehow in order to work with the LicheePi Zero? Have you tried it out?

Regards.

I haven’t tried. I would guess that the pin numbers need to be changed.

A small contribution to the community:

I have modified the Orange Pi Zero to be able to work with Lichee Pi
See attached file.

I have commented SD and WiFi dock I/Os, to avoid conflicts, but anyone who wants to use those pins, just uncomment the corresponding lines in the pin_mappings.py file.

I haven’t deeply tested yet, but the following methods work perfect: GPIO.setmode, GPIO.setup, GPIO.input, GPIO.output and GPIO.cleanup and that’s enough for me.

To use it, just uncompress and install.
In your Python code, use like:

import LPi.GPIO as GPIO
GPIO.setmode (GPIO.BOARD)
GPIO.setup (2, GPIO.OUT)
GPIO.output(2, True)
GPIO.output(2, False)

I numbered pins according to the lichee0_base diagram, and also created an image, you can find in doc directory.

Enjoy :relaxed:
Daniel

1 Like