Beiträge von T-Bird92

    Ja genau da habe ich ihn her! Mit einer LED funktioniert das ganze auch.... allerdings nicht mit dem Lüfter.... Ist ein ganz n normaler 4-Pin Pam Lüfter.

    Hi Leute,

    Möchte gerne einen PWM Lüfter mit meinem Raspberry Pi 3 steuern.
    Dazu habe ich folgenden Code programmiert:

    [font="monospace, sans-serif"]import RPi.GPIO as GPIO
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(12, GPIO.OUT)

    p = GPIO.PWM(12, 0.5)
    p.start(1)
    input('Press return to stop:')
    p.stop()
    GPIO.cleanup()[/font]

    [font="monospace, sans-serif"]allerdings dreht sich der Lüfter durchgängig nur mit der Leerlaufdrehzahl... Habe den Signaleingang mit dem GPIO Pin 12 (rechte Stiftleiste 5. von unten) verbunden.[/font]


    Na - das kann auch nicht klappen. Der Mac hat ja nun mal keine GPIOs. Was soll das Modul also machen, wenn es kompiliert wird? Einen Fehler schmeissen :)

    Warum willst du das denn ueberhaupt auf dem mac installieren? Laufen lassen kannst du - wie gerade festgestellt - eh nicht. Wenn es dir darum geht, PyCharm zu befrieden, weil es fehlende Module ankreidet, dann muesstest du ggf. ein mock-GPIO-modul bauen, welches die importe und ggf. Konstanten/Klassen/Funktionen mockt, damit PyCharm ruhe gibt.

    Ja das ist mir schon klar, dass der Mac das nicht kann :D aber ich wollte halt gerne, dass PiCharm nicht meckert :P
    Installieren der Module sollte doch eigentlich gehen oder? er sollte dann ja nur beim Kompilieren einen Fehler ausgeben.

    Hi Leute,

    bin noch neu hier und auch was den Raspberry Pi angeht kein Held.

    Es geht um folgendes:

    Ich programmiere meine Python-Files am Mac mit PiCharm und lade sie dann von der Software aus auf den Pi.
    Nachdem Hello World etc. funktioniert hat möchte ich nun beginnen die GPIOs anzusteuern. Allerdings ist die nötige lib nicht installiert.

    Nach Recherche im Internet kam ich auf folgende Command-Line, welche ich in das Terminal am Mac eingegeben habe:

    [font="sans-serif"]

    Code
    pip install RPi.GPIO

    [/font]

    [font="sans-serif"]Als Ausgabe bekomme ich aber folgenden Fehler:[/font]

    [font="sans-serif"][font="Menlo"]Collecting RPI.GPIO[/font]
    [/font]
    [font="Menlo"] Downloading RPi.GPIO-0.6.2.tar.gz[/font]

    [font="Menlo"]Installing collected packages: RPI.GPIO[/font]

    [font="Menlo"] Running setup.py install for RPI.GPIO ... error[/font]

    [font="Menlo"] Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/http://Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-sUk_gg/http://RPI.GPIO/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-16NuPR-record/install-record.txt --single-version-externally-managed --compile:[/font]

    [font="Menlo"] running install[/font]

    [font="Menlo"] running build[/font]

    [font="Menlo"] running build_py[/font]

    [font="Menlo"] creating build[/font]

    [font="Menlo"] creating build/lib.macosx-10.6-intel-2.7[/font]

    [font="Menlo"] creating build/lib.macosx-10.6-intel-2.7/RPi[/font]

    [font="Menlo"] copying RPi/__init__.py -> build/lib.macosx-10.6-intel-2.7/RPi[/font]

    [font="Menlo"] creating build/lib.macosx-10.6-intel-2.7/RPi/GPIO[/font]

    [font="Menlo"] copying RPi/GPIO/__init__.py -> build/lib.macosx-10.6-intel-2.7/RPi/GPIO[/font]

    [font="Menlo"] running build_ext[/font]

    [font="Menlo"] building 'RPi._GPIO' extension[/font]

    [font="Menlo"] creating build/temp.macosx-10.6-intel-2.7[/font]

    [font="Menlo"] creating build/temp.macosx-10.6-intel-2.7/source[/font]

    [font="Menlo"] /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c source/py_gpio.c -o build/temp.macosx-10.6-intel-2.7/source/py_gpio.o[/font]

    [font="Menlo"] source/py_gpio.c:87:4: error: function definition is not allowed here[/font]

    [font="Menlo"] {[/font]

    [font="Menlo"] ^[/font]

    [font="Menlo"] source/py_gpio.c:143:10: warning: implicit declaration of function 'cleanup_one' is invalid in C99 [-Wimplicit-function-declaration][/font]

    [font="Menlo"] cleanup_one();[/font]

    [font="Menlo"] ^[/font]

    [font="Menlo"] source/py_gpio.c:200:24: error: function definition is not allowed here[/font]

    [font="Menlo"] int setup_one(void) {[/font]

    [font="Menlo"] ^[/font]

    [font="Menlo"] source/py_gpio.c:293:13: warning: implicit declaration of function 'setup_one' is invalid in C99 [-Wimplicit-function-declaration][/font]

    [font="Menlo"] if (!setup_one())[/font]

    [font="Menlo"] ^[/font]

    [font="Menlo"] source/py_gpio.c:345:21: error: function definition is not allowed here[/font]

    [font="Menlo"] int output(void) {[/font]

    [font="Menlo"] ^[/font]

    [font="Menlo"] source/py_gpio.c:419:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer[/font]

    [font="Menlo"] if (!output())[/font]

    [font="Menlo"] ~~~~~~^[/font]

    [font="Menlo"] source/py_gpio.c:475:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer[/font]

    [font="Menlo"] if (!output())[/font]

    [font="Menlo"] ~~~~~~^[/font]

    [font="Menlo"] 2 warnings and 5 errors generated.[/font]

    [font="Menlo"] error: command '/usr/bin/clang' failed with exit status 1[/font]

    [font="Menlo"] [/font]

    [font="Menlo"] ----------------------------------------[/font]
    [font="sans-serif"][font="Menlo"]Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/http://Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-sUk_gg/http://RPI.GPIO/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-16NuPR-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-sUk_gg/http://RPI.GPIO/[/font][/font]

    [font="sans-serif"][font="Menlo"]Könnt ihr mir weiterhelfen? [/font][/font]

    [font="sans-serif"][font="Menlo"]Danke im Voraus![/font][/font]
    [font="sans-serif"][font="Menlo"]T-Bird[/font][/font]