what is wrong with this script and how do I get the value in a php script

Denis McMahon denismfmcmahon at gmail.com
Sun Oct 12 20:36:08 CEST 2014


On Sun, 12 Oct 2014 07:24:52 -0700, martijnperdaan wrote:

> what is wrong with this script and how do I get the value Rij1 and Rij2
> and Rij3 and Rij4 and Rij5 and Rij6 in a php script

I can see several pythonic errors in your script, however as for "what is 
wrong", I see no indication from you of what you expect it to do, what 
output you expect, what error messages you get when you try and run it 
etc.

Perhaps a better subject would have been "how to read gpio on raspberry 
pi"

It also helps if you can reduce your code example to the minimum needed 
to demonstrate the error. In this case, I would suggest that once you can 
read one input correctly, you should be able to expand that code to read 
all inputs.

The code below might help (uses 2.x style print):

import RPi.GPIO as GPIO

GPIO.setmode(mode)
GPIO.setup(17, GPIO.IN)

if GPIO.input(17) == GPIO.HIGH:
    print True
else:
    print False

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list