Issue #038 [Invalid/closed] - OUT/IN - change GPIO direction

Posted by portugalmidi

What steps will reproduce the problem?

How can I change GPIO (4) direction to out at RI boot

I'm using this code but GPIO 4 is in IN mode at startup

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.o$ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content = "height = device-height, width = 420, u$ <title>WebIOPi | Control your Pi's GPIO</title> <script type="text/javascript" src="/webiopi.js"></script> <script type="text/javascript">

    webiopi().ready(function() {
            var content, button;
            content = $(&quot;#content&quot;);

            WebIOPi.prototype.map(4,&quot;OUT&quot;,0);

            button = webiopi().createGPIOButton(4, &quot;1&quot;);
            content.append(button); 
    });
    function mousedown() {
            webiopi().setValue(4, 1);
            }

    function mouseup() {
            webiopi().setValue(4, 0);
    }

    &lt;/script&gt;
    &lt;style type=&quot;text/css&quot;&gt;
            button {
                    display: block;
                    margin: 5px 5px 5px 5px;
                    width: 360px;
                    height: 45px;
                    font-size: 24pt;
                    font-weight: bold;
                    color: White;
            }
            #gpio7.LOW {
                    background-color: White;
            }

            #gpio7.HIGH {
                    background-color: Red;
            }
    &lt;/style&gt;

</head> <body> <div id="content" align="center"></div> </body> </html>

Raspberry Pi board revision? (1 or 2) =>2


Comment 1

Posted by trouch

See https://code.google.com/p/webiopi/wiki/PYTHON Then come back on the google group instead of bugtracker is you still have questions.