Button input on GPIO

All the topics related to QLC+ on the Raspberry Pi
Post Reply
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

Hi

I'm trying to get a simple button attached to GPIO working. I'm using QLC+ 4.12.1 on a RPi 3 B+. I have a switch attached to pin 12, GPIO 18, channel 19. The switch works, if testing using a non QLC+ install. I've enabled GPIO input on the Inputs/Outputs, then configured a button to set a Scene, then attached channel 19 as the input channel. Once this is configured, a '?' is shown next to the channel number. I've also tried configuring via Auto Detect, but this has no effect. So, when I go into operate mode, the button sets the scene, but the external switch isn't.

I'm obviously missing a bit of configuration, but unsure what it is.

Any help would be appreciated.
User avatar
GGGss
Posts: 2732
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

Some pointers i can give you (without the extensive explanation - there are tons of topics here)

Is your circuit driving the GPIO correct? Does the button pull the input to '0' or is it raising to '+3,3V' ?
You have to tell Raspi to use GPIO as input. (See the .pdf document)
Next in your input/output you enable GPIO and when you close/open the HW switch - do you see the Joystick wiggling?
For better reading you should create an input profile to ommit the '?' in your bound input signal to a function.
All electric machines work on smoke... when the smoke escapes... they don't work anymore
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

Hi, thanks for your help

The switch pulls the input low.

On Inputs/Outputs page I've set GPIO to input, and also the input line I'm using (GPIO 18).

I'm a bit confused by your question 'do you see the Joystick wiggling?' I'm unsure where the joystick is.

Also, creating a profile seems like a good idea, but I'm unsure where the profile editor is on RPi, and the GPIO does not appear in my desktop version of the profile editor.

Cheers
User avatar
GGGss
Posts: 2732
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

DWC wrote: Tue Apr 30, 2019 10:47 am I'm a bit confused by your question 'do you see the Joystick wiggling?' I'm unsure where the joystick is.
See https://www.qlcplus.org/docs/html_en_EN ... pping.html under "input and feedback"
All electric machines work on smoke... when the smoke escapes... they don't work anymore
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

Okay got it. No wiggling joystick for me.

Made a bit of progress. Sticking a meter on the input I've found the input doesn't have the internal pull up enabled, which leaves two possibilities: the input is pulled down or the input is floating. Anyone know which one is the case? Do I need to swap my switch to the 3.3V, or do I put in an external pull up resistor?
OddSocks
Posts: 152
Joined: Tue Apr 14, 2015 11:33 am
Real Name: Tim Cullingworth

I believe that the IO pins can have internal pull-up or pull-down enabled.

This is an optional argument in the GPIO.setup() function.
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

Yes, that looks like exactly what I want.

Where would this go? Is it part of the Script editor? Or would it be put in a config file.
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

So, sorted this out, and the pull up is working.

Doing a python script for this seemed overkill, so I looked at alternatives. Found there was a startup mechanism ideal for this. By putting the following line in /boot/config.txt sets the GPIO pull up on:

Code: Select all

gpio=18=ip,pu


An explanation of the GPIO command in config.txt is here:

https://www.raspberrypi.org/documentati ... xt/gpio.md

So now I have my working GPIO input, but found two things still to sort out:

1) It doesn't auto detect.

2) The channel number has a question mark next to it.

These may be related, not sure. Someone noted the question mark is due to a lack of a profile, so I'll look at that, next.

Hope this is useful to someone.
User avatar
GGGss
Posts: 2732
Joined: Mon Sep 12, 2016 7:15 pm
Location: Belgium
Real Name: Fredje Gallon

Isn't this the info the supplied .pdf is into 'giving lead hints' comes to mind?
You only get access to the .pdf if you contribute to this project?
Should this topic be hidden?

Forgive me above; your very handy instructions are very welcome to me too
All electric machines work on smoke... when the smoke escapes... they don't work anymore
DWC
Posts: 11
Joined: Sat Apr 27, 2019 10:13 am
Real Name: David Wilson Clarke

There is some information on GPIO in the pdf for Raspberry Pi, but not much. Mainly the mapping from pins to channels. A bit more would be welcome.

Would be happy to provide some info for the manual, if required. And also, as I work it out.
Post Reply