I am trying to figure out how to get my Pi to activate a GPIO pin when a user types certain things.
For example: if a user types Hello, the Python code would activate GPIO 7, if a user types Heello, nothing would happen.
I have tried using strings, vars, raw_input(), input() but it either gives me syntax errors or just activates the GPIO as soon as I run the script without any user input.
Below is just one of the things I've tried.
- Code: Select all
while 1:
if raw_input:
raw_input("Hello")
GPIO.output(7, False)
else:
GPIO.output(7, True)
Like I said, I am a complete novice with programming but I have been messing about with this one thing for about 6 hours and I still have no idea how to do it.
Could someone kindly help me out and point out what I'm doing wrong.
Thank you very much.
Morgan