Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79013

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

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: what is wrong with this script and how do I get the value in a php script
Date 2014-10-12 18:36 +0000
Organization A noiseless patient Spider
Message-ID <m1ehmo$qr1$3@dont-email.me> (permalink)
References <05f27d81-372d-4242-bc62-e738e23680d4@googlegroups.com>

Show all headers | View raw


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@gmail.com

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

what is wrong with this script and how do I get the value in a php script martijnperdaan@gmail.com - 2014-10-12 07:24 -0700
  Re: what is wrong with this script and how do I get the value in a php script Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-12 12:47 -0400
  Re: what is wrong with this script and how do I get the value in a php script Peter Pearson <pkpearson@nowhere.invalid> - 2014-10-12 17:01 +0000
  Re: what is wrong with this script and how do I get the value in a php script Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-12 18:36 +0000

csiph-web