Procházet zdrojové kódy

Update readme and add code snippet

Ubuntu před 5 roky
rodič
revize
c19838bafa
2 změnil soubory, kde provedl 36 přidání a 5 odebrání
  1. 21 1
      README.md
  2. 15 4
      server/index.html

+ 21 - 1
README.md

@@ -1,3 +1,23 @@
 # RoboCar
 
-This repo is for MyToysRHacked project to control the remote car
+This repo is for MyToysRHacked project to control the remote car
+
+## Installation
+ssh to the pi
+
+```
+sudo mkdir /opt/RoboCar
+sudo chown $USER:$GROUP /opt/RoboCar
+git clone https://git.gilgoldman.com/Eran/RoboCar.git /opt/RoboCar/
+chmod +x /opt/RoboCar/server/websocketd
+chmod +x /opt/RoboCar/server/socketScript.py
+echo "@reboot /opt/RoboCar/server/websocketd --port=8080 /opt/RoboCar/server/socketScript.py" >> /tmp/cron.install
+crontab /tmp/cron.install
+sudo apt install nginx
+sudo mkdir /var/www/RoboCar
+sudo chown $USER:$GROUP /var/www/RoboCar/
+sudo sed -i 's/www\/html/www\/RoboCar/g' /etc/nginx/sites-available/default
+sudo service nginx restart
+```
+
+

+ 15 - 4
server/index.html

@@ -42,11 +42,22 @@
                     <h2>
                       Snippet 1
                     </h2>
+		    <samp>
+                       import RPi.GPIO as GPIO
+		       import time
+
+		       GPIO.setmode(GPIO.BCM)
+		       GPIO.setup(20, GPIO.OUT)
+		       GPIO.output(20,1)
+		       GPIO.setup(21, GPIO.OUT)
+		       GPIO.output(21,1)
+		       GPIO.setup(8, GPIO.OUT)
+		       GPIO.output(8,1)
+		       GPIO.setup(7, GPIO.OUT)
+		       GPIO.output(7,1)
+                    </samp>
                     <p>
-                       Some python code
-                    </p>
-                    <p>
-                      <a class="btn btn-primary btn-large" href="#">Load</a>
+		    <a class="btn btn-primary btn-large" onclick="(function(){alert(this);})()">Load</a>
                     </p>
                   </div>
                 </div>