nicolaiev / webiopi

Automatically exported from code.google.com/p/webiopi
0 stars 0 forks source link

OUT/IN - change GPIO direction #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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" "http://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 = $("#content");

                WebIOPi.prototype.map(4,"OUT",0);

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

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

        </script>
        <style type="text/css">
                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;
                }
        </style>
</head>
<body>
<div id="content" align="center"></div>
</body>
</html>

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

Original issue reported on code.google.com by portugal...@gmail.com on 4 Mar 2013 at 7:40

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

Original comment by tro...@trouch.com on 4 Mar 2013 at 8:02