Open GoogleCodeExporter opened 9 years ago
I thought this one and I would like to reuse the GPIO setup/reset notation and
generalize it to other kind device.
Assume we have :
[DEVICES]
mygpio = MCP23017
mydac = MCP4921
then we could have :
[mygpio]
# setup
1 = IN
2 = OUT 0
3 = OUT 0
4 = OUT 1
[~mygpio]
# reset
1 = IN
2 = IN
3 = IN
4 = OUT 0
[mydac]
0 = 1.0
Original comment by tro...@trouch.com
on 25 Feb 2013 at 1:50
this is even better as it handles the value (re)setting also. maybe pullups can
be done also this way.
Original comment by andreas....@googlemail.com
on 25 Feb 2013 at 2:06
I think I will add this after the next release as we can init devices using
custom scripts and deviceInstance(name) Python function.
But I moved device init before script loading or the device will be not found
in script setup().
I also imported deviceInstance in root package, to help calling it using
webiopi.deviceInstance
see r977
Original comment by tro...@trouch.com
on 25 Feb 2013 at 7:51
Original comment by tro...@trouch.com
on 27 Mar 2013 at 11:59
Original comment by tro...@trouch.com
on 28 Mar 2013 at 12:03
Original comment by tro...@trouch.com
on 4 Jan 2014 at 9:01
Is this issue solved in webiopi-0.7.0?
How do you setup pullups or pulldowns in the config file?
Best regards
Jacques
Original comment by j...@csm-instruments.com
on 30 Mar 2014 at 3:36
No, 0.7.0 makes no updates here.
Pullups/downs can be set for GPIOs, but I don't know exactly how, there was
some answer in the support group how to do that some days/weeks ago, please use
the search function of the group to find it.
Best
Andreas
Original comment by andreas....@googlemail.com
on 31 Mar 2014 at 12:15
Hello,
I have found a python program which does it, could it be done also in the
Webiopi config file ?
#1/usr/bin/env python
#sample python code to test digital inputs on Custard Pi 2
#www.sf-innovations.co.uk
#This program sets up pins 7,22,18 & 16
#As inputs with a pull up resistor
#Scans all 4 inputs
#Prints results to screen
#Waits 1 second
#Repeats 10 times
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
Best regards
Jacques
Original comment by j...@csm-instruments.com
on 1 Apr 2014 at 9:15
Sorry, no WebIOPi has been implemented to be NOT dependent on other packages or
components.
The code you show uses the RPi.GPIO package which is NOT part of WebIOPi. Both
can't be used together as their functionality overlaps partly.
However, the calls you show above can (almost identical) be put into a WebIOPi
custom script in the setup() section (thus overlaps). The idea is to avoid this
and allow such settings with WebIIOPi config file entries.
But, as I mentioned, this is still tbd.
Andreas
Original comment by andreas....@googlemail.com
on 1 Apr 2014 at 10:18
Original issue reported on code.google.com by
andreas....@googlemail.com
on 25 Feb 2013 at 11:48