Added print CSS, shortened Traffic HAT page

This commit is contained in:
Phil Howard 2015-04-18 22:27:03 +01:00
parent 8be2ea8f39
commit 91bfdde34b
3 changed files with 46 additions and 68 deletions

37
resources/print.css Normal file
View File

@ -0,0 +1,37 @@
#content,
nav#gpio,
div#pinbasebplus,
div#pinbase {background:transparent;}
#article {padding:0px;}
.main-nav, .overlay-container, .logo img {display:none;}
ul.bottom a {
color:#000000;
}
.logo, .logo a, .logo span.out, .logo span {
color:#000000;
}
nav#gpio li.overlay-pin a,
nav#gpio ul.bottom li.overlay-pin a,
nav#gpio li.active a,
table th{
background:transparent;
}
* {color:#000000 !important;}
ul.top a *, ul.bottom a * {
color:#999999 !important;
}
nav#gpio li.overlay-pin a *,
nav#gpio ul.bottom li.overlay-pin a *,
nav#gpio li.active * {
color:#000000 !important;
font-weight:bold;
}
.prettyprint.linenums, .prettyprint {box-shadow:none;-webkit-box-shadow:none;background:transparent;}

View File

@ -2,8 +2,8 @@
---
name: Traffic HAT
manufacturer: Ryanteck LTD.
url: http://www.ryanteck.uk/
buy: http://www.ryanteck.uk/
url: http://www.ryanteck.uk/store/traffichat
buy: http://www.ryanteck.uk/store/traffichat
description: A quick and easy way to learn the basics of GPIO on a budget. All in
a nice HAT.
pincount: 40
@ -37,76 +37,16 @@ pin:
import RPi.GPIO as IO
from time import sleep
IO.setmode(IO.BCM)
#Lights
IO.setup(22,IO.OUT)
IO.setup(23,IO.OUT)
IO.setup(24,IO.OUT)
#Buzz
#Buzzer
IO.setup(5,IO.OUT)
#Button
IO.setup(25,IO.IN,pull_up_down=IO.PUD_UP)
while True:
IO.output(22,1) # Turn the Green LED On / 1
sleep(0.11) #S1
print("Green ON")
if(IO.input(25) == 0):
print("BUTTON PRESS")
IO.output(22,0) # Turn the Green LED Off / 0
print("Green Off")
IO.output(23,1) # Turn the Yellow LED On / 1
print("Yellow ON")
print("Sleep")
sleep(2) # Wait for 1 Second
print("Sleeped")
IO.output(23,0) # Turn the Yellow LED Off / 0
print("Yellow Off")
IO.output(24,1) # Turn the Red LED On / 1
print("Red ON")
print("Sleep")
sleep(2) # Wait for 1 Second
print("Sleeped")
i = 0 # Set A Counter Variable
while (i<10): # The Repeat Loop
print("Buzz")
IO.output(5,1) # Turn the Yellow LED On / 1
sleep(0.1) # Wait for 0.1 Seconds
IO.output(5,0) # Turn the Yellow LED Off / 0
sleep(0.1) # Wait for 0.1 Seconds
i = i+1 #We add 1 to the counter to keep track of the loop
# We want to blink the Yellow LED 3 Times
print("Count Begin")
sleep(0.5)
i = 0
while (i<3): # The Repeat Loop
print("Blink")
IO.output(23,1) # Turn the Yellow LED On / 1
sleep(0.5) # Wait for 0.1 Seconds
IO.output(23,0) # Turn the Yellow LED Off / 0
sleep(0.5) # Wait for 0.1 Seconds
i = i+1 #We add 1 to the counter to keep track of the loop
print("Red Off")
IO.output(24,0) # Turn the Red LED Off / 0
print("Green ON")
IO.output(22,1) # Turn the Green LED On / 1
sleep(2)
```

View File

@ -3,10 +3,11 @@
<head>
<title>{{title}}</title>
<meta name="description" content="{{description}}" />
<link href='http://fonts.googleapis.com/css?family=Sanchez|Ubuntu+Mono' rel='stylesheet' type='text/css' />
<link href='//fonts.googleapis.com/css?family=Sanchez|Ubuntu+Mono' rel='stylesheet' type='text/css' />
<link href='{{resource_url}}prettify/prettify.css' rel='stylesheet' />
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link href="{{resource_url}}pinout.css?v={{v}}" rel="stylesheet">
<link href="{{resource_url}}print.css?v={{v}}" rel="stylesheet" media="print">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<script type='text/javascript'>
var _gaq = _gaq || [];
@ -51,8 +52,8 @@
</div>
</div>
<script type="text/javascript" src="http://cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/prettify/0.1/prettify.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/prettify/0.1/prettify.js"></script>
<script src='{{resource_url}}prettify/lang-ruby.js'></script>
<script src='{{resource_url}}prettify/lang-bash.js'></script>
<script src='{{resource_url}}gaat.js'></script>