2017-05-07 15 views
0

こんにちは、私はロボット制御システムを作っています。私は作ったウェブサイトからコントロールしたいと思っています。しかし、これをPythonコードにリンクして、Raspberry pi GPIOを制御する方法は見つけられません。PythonコードからHTMLコードへ

<html> 
<head> 
    <style type="text/css"> 
     #commands{ 
      text-align: center; 
      color: FF8300; 
      font-size: 100px; 
     } 
     .controllbox{ 
      width: 610px; 
      margin: 0 auto; 
     } 
     #arrowUp{ 
      text-align: center; 
      position: static; 
     } 
     #arrowRight{ 
      text-align: right; 
      position: static; 
      margin-top: 0; 
     } 
     #arrowDown{ 
      text-align: center; 
      position: static; 
     } 
     #arrowLeft{ 
      text-align: left; 
      position: static; 
      margin-top: -200px; 

     } 
     #stop{ 
      width: 120px; 
      height: auto; 
      margin: 0 auto; 
      margin-top: -65%; 
      margin-left: 34%; 
      text-align: center; 
      position: static; 


     } 
    </style> 
</head> 
<body> 

    <h1 id="commands">Controll Me!!</h1> 
    <div class="controllBox"> 
     <div id="arrowUp"><img src="arrowUp.jpg" class="controll" id="button1"></div> 
     <div id="arrowRight"><img src="arrowRight.jpg" class="controll" id="button2"></div> 
     <div id="arrowLeft"><img src="arrowLeft.jpg" class="controll" id="button3"></div> 
     <div id="arrowDown"><img src="arrowDown.jpg" class="controll" id="button4"></div> 
     <div id="stop"><img src="stop.jpg" class="controll" id="button5"></div> 
    </div> 
<script type="text/javascript"> 

     document.getElementById('button1').onclick = function(){ 
      document.getElementById('commands').innerHTML = 'Foward' 
     } 
     document.getElementById('button2').onclick = function(){ 
      document.getElementById('commands').innerHTML = 'Right' 
     } 
     document.getElementById('button3').onclick = function(){ 
      document.getElementById('commands').innerHTML = 'Left' 
     } 
     document.getElementById('button4').onclick = function(){ 
      document.getElementById('commands').innerHTML = 'Backwards' 
     } 
     document.getElementById('button5').onclick = function(){ 
      document.getElementById('commands').innerHTML = 'Stop' 
     } 

    </script> 
</body> 

私は誰もが知っているのかどうかを確認するために探しています:

私のウェブサイトのアクティブなバージョンは、HTMLのソースコードはここにあるwww.awesomecoding.co.ukにあり、これを行うには簡単な、まだラグフリーの方法。 私がやっているこのプロジェクトに追加できるアドバイスありがとうございました。

答えて

0

最良かつ簡単な方法は、バックエンド Flask DocでPythonのフラスコのフレームワークを使用して、私の疑いを確認し、そのための Flask Tutorial

+0

おかげで、その大きな助けと私はそれになりますことです。 –

関連する問題