GPIO - with LED Squid

  1. 9 months ago

    I recently purchased a Squid LED for use with my Pi.
    https://www.robotshop.com/uk/monk-makes ... ry-pi.html

    I can see it comes with a Python Library here;
    https://github.com/simonmonk/squid
    .. but I am just experimenting with it using the standard GPIO Xojo library instead.

    The python library seems to use a 'ChangeDutyCycle' function to vary the brightness of the LED and I don't see / understand if there is an equivalent in the Xojo library. I'd rather not have to shell out to a python script if I can help it.

    Does anyone have any experience with a LED squid like this and can offer some help please.
    I've struggled also to match the same function (as the python library) using the standard gpio command line tools..

    Any clues?

    Regards.

  2. Albin K

    11 Mar 2019 Europe (Sweden)

    That might be a PWM(pulse width modulation) thing.
    But I have not used that in Xojo but there might be something about it in the docs, I hope :)

  3. I did read that PWM only works on GPIO 18 (don't know if that's totally true) and the squid needs 3 different pins.
    My experiments with the GPIO command line tool allows me to execute 'gpio -g pwm 18 500' which enables a red LED at ~50% brightness. Using the same on a different pin doesn't work, so I guess perhaps pwm is perhaps just on 18 after all.

    Guessing that ChangeDutyCycle is therefore the way the Python library pull off the brightness trick..

  4. Paul L

    11 Mar 2019 Xojo Inc, Third Party Store

    The Xojo library is built on top of wiringPi so if you can find the wiringPi command-line commands to do a ChangeDutyCycle (definitely PWM related) then the equivalent ought to work with the Xojo library.

    This might be relevant:
    https://raspberrypi.stackexchange.com/questions/4906/control-hardware-pwm-frequency

or Sign Up to reply!