0

I have downloaded some pre-made code from Freenove - https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi

Freenove uses WiringPi. So I downloaded WiringPi and ran build.

Question 1 - Does build compiles the .c code in WiringPi, specifically the wiringPi library? Where is the library kept on the system?

Then I build the Blink.c code at https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi/blob/master/Code/C_Code/01.1.1_Blink/Blink.c and executed the code using -lwiringPi option. The program ran fine.

The I executed the python version of the code https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi/tree/master/Code/Python_Code/01.1.1_Blink using python3. That worked fine as well.

While I understand how the C code is working by following the wiringPi reference guide here http://wiringpi.com/reference/setup/, I don't understand the function calls and modules from the Python code.

Eg. where is import RPi.GPIO as GPIO defined and where should I look to find the functions available within RPi.GPIO and their meanings?

https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi/blob/master/Code/Python_Code/01.1.1_Blink/Blink.py

Where is from gpiozero import LED defined in Blink2.py - https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi/blob/master/Code/Python_Code/01.1.1_Blink/Blink2.py

1 Answer 1

0

WiringPi is a C library used to access the GPIO. It is pre-installed in Raspbian.

RPi.GPIO is a Python module to access the GPIO. It is pre-installed in Raspbian.

gpiozero is a Python module to access the GPIO. It is pre-installed in Raspbian.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.