Update:
in qt lassen sich nicht nur z.B. wiringPi GPIO-r/w Funktionen benutzen, sondern sogar auch multithreading mit pthread statt der qt-eigenen GPIO-controls und QThread. Beide (wiringPi, pthread) sind ja reine ISO-C libs, während qt ein C++ OOP Programm ist, trotzdem funktioniert es einwandfrei simultan:
https://github.com/dsyleixa/Raspberr...oolbar_pthread
https://github.com/dsyleixa/Raspberr...hread_textedit
https://github.com/dsyleixa/Raspberr...creenshot.jpeg
Zur Einbindung von pthread:
1.) im .pro file: LIBS += -lpthread
2.) im sourcecode von mainwindow.cpp: #include <pthread.h>
/*
* GPIO setup (BCM numbering):
* 23: Output (green LED + resistor) // switchable by widget buttons)
* 24: Input (default: GPIO24->switch->GND)
* 25: Output (red LED + resistor) // LED is blinking while program runs (pthread)
*
* Input 24 can be switched from INPUT_PULLUP (default) to INPUT_PULLDOWN
* (beneath toolbar option Edit)
* when INPUT_PULLDOWN is activated, the switch has to be re-wired
* (GPIO24->switch->+3v3)
*
*/
Lesezeichen