Added print CSS, shortened Traffic HAT page
This commit is contained in:
parent
8be2ea8f39
commit
91bfdde34b
|
@ -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;}
|
|
@ -2,8 +2,8 @@
|
||||||
---
|
---
|
||||||
name: Traffic HAT
|
name: Traffic HAT
|
||||||
manufacturer: Ryanteck LTD.
|
manufacturer: Ryanteck LTD.
|
||||||
url: http://www.ryanteck.uk/
|
url: http://www.ryanteck.uk/store/traffichat
|
||||||
buy: http://www.ryanteck.uk/
|
buy: http://www.ryanteck.uk/store/traffichat
|
||||||
description: A quick and easy way to learn the basics of GPIO on a budget. All in
|
description: A quick and easy way to learn the basics of GPIO on a budget. All in
|
||||||
a nice HAT.
|
a nice HAT.
|
||||||
pincount: 40
|
pincount: 40
|
||||||
|
@ -37,76 +37,16 @@ pin:
|
||||||
import RPi.GPIO as IO
|
import RPi.GPIO as IO
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
IO.setmode(IO.BCM)
|
IO.setmode(IO.BCM)
|
||||||
|
|
||||||
|
#Lights
|
||||||
IO.setup(22,IO.OUT)
|
IO.setup(22,IO.OUT)
|
||||||
IO.setup(23,IO.OUT)
|
IO.setup(23,IO.OUT)
|
||||||
IO.setup(24,IO.OUT)
|
IO.setup(24,IO.OUT)
|
||||||
|
|
||||||
#Buzz
|
#Buzzer
|
||||||
IO.setup(5,IO.OUT)
|
IO.setup(5,IO.OUT)
|
||||||
|
|
||||||
|
#Button
|
||||||
IO.setup(25,IO.IN,pull_up_down=IO.PUD_UP)
|
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)
|
|
||||||
|
|
||||||
```
|
```
|
|
@ -3,10 +3,11 @@
|
||||||
<head>
|
<head>
|
||||||
<title>{{title}}</title>
|
<title>{{title}}</title>
|
||||||
<meta name="description" content="{{description}}" />
|
<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='{{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="//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}}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">
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
|
@ -51,8 +52,8 @@
|
||||||
</div>
|
</div>
|
||||||
</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="//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/prettify/0.1/prettify.js"></script>
|
||||||
<script src='{{resource_url}}prettify/lang-ruby.js'></script>
|
<script src='{{resource_url}}prettify/lang-ruby.js'></script>
|
||||||
<script src='{{resource_url}}prettify/lang-bash.js'></script>
|
<script src='{{resource_url}}prettify/lang-bash.js'></script>
|
||||||
<script src='{{resource_url}}gaat.js'></script>
|
<script src='{{resource_url}}gaat.js'></script>
|
||||||
|
|
Loading…
Reference in New Issue