Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5164

Python • Re: Python3 code for ps4 controller mapping

$
0
0

Any advice would be appreciated as I'm new to Python programming.
As it says in your photo, but in different words.

button_11 and button_12 are boolean variables - they are either True or False. (It would help to see the part of the script where their values are set.)

'on' is a string - a sequence of characters. You probably intend it to represent whether an LED, switch or other circuit has been turned on?

It is simply not meaningful to compare True/False with 'some characters'

One solution would be to use the constants provided by the RPi.GPIO library, which you have used elsewhere.

Something like -

Code:

if button_11 == GPIO.HIGH :

Statistics: Posted by B.Goode — Wed Jul 03, 2024 8:39 am



Viewing all articles
Browse latest Browse all 5164

Trending Articles