From 91bfdde34bea388c227c5c6b2bd047258f6cad00 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sat, 18 Apr 2015 22:27:03 +0100 Subject: [PATCH] Added print CSS, shortened Traffic HAT page --- resources/print.css | 37 +++++++++++++++++ src/en-GB/overlay/traffic-hat.md | 70 +++----------------------------- src/en-GB/template/layout.html | 7 ++-- 3 files changed, 46 insertions(+), 68 deletions(-) create mode 100644 resources/print.css diff --git a/resources/print.css b/resources/print.css new file mode 100644 index 0000000..924849d --- /dev/null +++ b/resources/print.css @@ -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;} \ No newline at end of file diff --git a/src/en-GB/overlay/traffic-hat.md b/src/en-GB/overlay/traffic-hat.md index 9d84f0e..4fa0a03 100644 --- a/src/en-GB/overlay/traffic-hat.md +++ b/src/en-GB/overlay/traffic-hat.md @@ -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) - ``` \ No newline at end of file diff --git a/src/en-GB/template/layout.html b/src/en-GB/template/layout.html index c215b93..9035462 100644 --- a/src/en-GB/template/layout.html +++ b/src/en-GB/template/layout.html @@ -3,10 +3,11 @@ {{title}} - + + - + +