Hello, I am new to programming on the Pi and am getting most of my answers from the internet however my searches for an answer for my current predicament is proving difficult.
So the question is; I am playing around with LED’s and buttons and repeating all these lines of code is very time consuming
What I am looking to do is rename a line of code to something shorter for example something like turning an led on and off, instead of having to wright ‘gpio.output(23, gpio.HIGH)’ be able to shorten it to something like led23ON.
Another thing I would like to do is groupe lines of code into one command fore example;
gpio.output(18, gpio.HIGH)
gpio.output(23, gpio.HIGH)
gpio.output(24, gpio.HIGH)
instead of having to write all of the line repetedly cobine them into one command like ‘all_ON’
I hope this is understandable but if not let me know and i will try and reword it.
Thanks Henry