Updates, overlay drop down menu
This commit is contained in:
parent
28f1dced6a
commit
3f57de7ffd
|
@ -0,0 +1,9 @@
|
||||||
|
#TODO
|
||||||
|
|
||||||
|
Add pin setup to overlays- IN/OUT, plus polarity Active HIGH/LOW
|
||||||
|
|
||||||
|
Add PNG renderer to turn JSON overlays into usable pinout images
|
||||||
|
|
||||||
|
Change pincount to useful figure that details compatibility - HAT, 26 pin, etc
|
||||||
|
|
||||||
|
Remove "exclusive" from JSON since all defined, non-i2c or SPI pins will be exclusive anyway
|
|
@ -1,4 +1,4 @@
|
||||||
#Explorer HAT Pro
|
#Explorer HAT and Explorer HAT Pro
|
||||||
|
|
||||||
5V inputs and outputs, touch pads, LEDs, analog inputs and an H-Bridge motor driver make up the Explorer HAT Pro- a jack of all trades prototyping side-kick for your Raspberry Pi.
|
5V inputs and outputs, touch pads, LEDs, analog inputs and an H-Bridge motor driver make up the Explorer HAT Pro- a jack of all trades prototyping side-kick for your Raspberry Pi.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
explorer-hat-pro.md
|
|
@ -6,14 +6,17 @@ import re
|
||||||
import os
|
import os
|
||||||
|
|
||||||
resource_url = '/pinout2/resources/'
|
resource_url = '/pinout2/resources/'
|
||||||
#resource_url = '/resources/'
|
resource_url = '/resources/'
|
||||||
|
|
||||||
overlays = ['pibrella','explorer-hat-pro']
|
overlays = ['pibrella','explorer-hat-pro','explorer-hat']
|
||||||
|
|
||||||
template = open('template/layout.html').read()
|
template = open('template/layout.html').read()
|
||||||
|
|
||||||
pages = {}
|
pages = {}
|
||||||
navs = {}
|
navs = {}
|
||||||
|
select_overlays = {}
|
||||||
|
|
||||||
|
overlays_html = ''
|
||||||
|
|
||||||
def slugify(value):
|
def slugify(value):
|
||||||
"""
|
"""
|
||||||
|
@ -31,7 +34,6 @@ def load_overlay(overlay):
|
||||||
except IOError:
|
except IOError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
loaded['long_description'] = load_md('description/overlay/{}.md'.format(overlay))
|
loaded['long_description'] = load_md('description/overlay/{}.md'.format(overlay))
|
||||||
|
|
||||||
details = []
|
details = []
|
||||||
|
@ -60,6 +62,7 @@ def load_overlay(overlay):
|
||||||
loaded['page_url'] = slugify(loaded['name'])
|
loaded['page_url'] = slugify(loaded['name'])
|
||||||
pages[loaded['page_url']] = render_overlay_page(loaded)
|
pages[loaded['page_url']] = render_overlay_page(loaded)
|
||||||
navs[loaded['page_url']] = render_nav(loaded['page_url'], overlay=loaded)
|
navs[loaded['page_url']] = render_nav(loaded['page_url'], overlay=loaded)
|
||||||
|
select_overlays[loaded['page_url']] = loaded['name']
|
||||||
return loaded
|
return loaded
|
||||||
|
|
||||||
def load_md(filename):
|
def load_md(filename):
|
||||||
|
@ -132,7 +135,7 @@ def render_pin(pin_num, selected_url, overlay=None):
|
||||||
|
|
||||||
if overlay != None and str(pin_num) in overlay['pin']:
|
if overlay != None and str(pin_num) in overlay['pin']:
|
||||||
pin_text_name = ''
|
pin_text_name = ''
|
||||||
print(overlay)
|
#print(overlay)
|
||||||
pin_name = overlay['pin'][str(pin_num)]['name']
|
pin_name = overlay['pin'][str(pin_num)]['name']
|
||||||
pin_used = True
|
pin_used = True
|
||||||
#alternates = []
|
#alternates = []
|
||||||
|
@ -199,6 +202,9 @@ pins = db['pins']
|
||||||
|
|
||||||
overlays = map(load_overlay,overlays)
|
overlays = map(load_overlay,overlays)
|
||||||
|
|
||||||
|
for url in select_overlays:
|
||||||
|
overlays_html += '<option value="{}">{}</option>'.format(url, select_overlays[url])
|
||||||
|
|
||||||
|
|
||||||
pages['index'] = render_overlay_page({'name':'Index','long_description':load_md('description/index.md')})
|
pages['index'] = render_overlay_page({'name':'Index','long_description':load_md('description/index.md')})
|
||||||
navs['index'] = render_nav('index')
|
navs['index'] = render_nav('index')
|
||||||
|
@ -208,7 +214,7 @@ print('Rendering pin pages...')
|
||||||
for pin in range(1,len(pins)+1):
|
for pin in range(1,len(pins)+1):
|
||||||
(pin_url, pin_html) = render_pin_page(pin)
|
(pin_url, pin_html) = render_pin_page(pin)
|
||||||
pin_nav = render_nav(pin_url)
|
pin_nav = render_nav(pin_url)
|
||||||
pin_html = template.replace('{{nav}}',pin_nav).replace('{{content}}',pin_html).replace('{{resource_url}}',resource_url)
|
pin_html = template.replace('{{nav}}',pin_nav).replace('{{content}}',pin_html).replace('{{resource_url}}',resource_url).replace('{{overlays}}',overlays_html)
|
||||||
|
|
||||||
print('Outputting page {}'.format(pin_url))
|
print('Outputting page {}'.format(pin_url))
|
||||||
|
|
||||||
|
@ -223,7 +229,7 @@ for url in pages:
|
||||||
content = pages[url]
|
content = pages[url]
|
||||||
nav = navs[url]
|
nav = navs[url]
|
||||||
print('Outputting page {}'.format(url))
|
print('Outputting page {}'.format(url))
|
||||||
html = template.replace('{{nav}}',nav).replace('{{content}}',content).replace('{{resource_url}}',resource_url)
|
html = template.replace('{{nav}}',nav).replace('{{content}}',content).replace('{{resource_url}}',resource_url).replace('{{overlays}}',overlays_html)
|
||||||
with open(os.path.join('output','{}.html'.format(url)),'w') as f:
|
with open(os.path.join('output','{}.html'.format(url)),'w') as f:
|
||||||
f.write(html)
|
f.write(html)
|
||||||
|
|
||||||
|
|
|
@ -10,67 +10,83 @@
|
||||||
"pin": {
|
"pin": {
|
||||||
"7": {
|
"7": {
|
||||||
"name": "LED 1",
|
"name": "LED 1",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"11": {
|
"11": {
|
||||||
"name": "LED 2",
|
"name": "LED 2",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"13": {
|
"13": {
|
||||||
"name": "LED 3",
|
"name": "LED 3",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"29": {
|
"29": {
|
||||||
"name": "LED 4",
|
"name": "LED 4",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"31": {
|
"31": {
|
||||||
"name": "Output 1",
|
"name": "Output 1",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"32": {
|
"32": {
|
||||||
"name": "Output 2",
|
"name": "Output 2",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"33": {
|
"33": {
|
||||||
"name": "Output 3",
|
"name": "Output 3",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"36": {
|
"36": {
|
||||||
"name": "Output 4",
|
"name": "Output 4",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"16": {
|
"16": {
|
||||||
"name": "Input 1",
|
"name": "Input 1",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"15": {
|
"15": {
|
||||||
"name": "Input 2",
|
"name": "Input 2",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"18": {
|
"18": {
|
||||||
"name": "Input 3",
|
"name": "Input 3",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"22": {
|
"22": {
|
||||||
"name": "Input 4",
|
"name": "Input 4",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"40": {
|
"40": {
|
||||||
"name": "Motor 2 +",
|
"name": "Motor 2 +",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"37": {
|
"37": {
|
||||||
"name": "Motor 2 -",
|
"name": "Motor 2 -",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"35": {
|
"35": {
|
||||||
"name": "Motor 1 +",
|
"name": "Motor 1 +",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"38": {
|
"38": {
|
||||||
"name": "Motor 1 -",
|
"name": "Motor 1 -",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
{
|
||||||
|
"name": "Explorer HAT",
|
||||||
|
"manufacturer": "Pimoroni",
|
||||||
|
"url": "https://github.com/pimoroni/explorer-hat",
|
||||||
|
"description": "An all-in-one light, input, touch and output add-on board.",
|
||||||
|
"pincount": 40,
|
||||||
|
"pin": {
|
||||||
|
"7": {
|
||||||
|
"name": "LED 1",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"name": "LED 2",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"13": {
|
||||||
|
"name": "LED 3",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"29": {
|
||||||
|
"name": "LED 4",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"31": {
|
||||||
|
"name": "Output 1",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"32": {
|
||||||
|
"name": "Output 2",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"33": {
|
||||||
|
"name": "Output 3",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"36": {
|
||||||
|
"name": "Output 4",
|
||||||
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"16": {
|
||||||
|
"name": "Input 1",
|
||||||
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"15": {
|
||||||
|
"name": "Input 2",
|
||||||
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"18": {
|
||||||
|
"name": "Input 3",
|
||||||
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
|
},
|
||||||
|
"22": {
|
||||||
|
"name": "Input 4",
|
||||||
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,55 +7,68 @@
|
||||||
"pin": {
|
"pin": {
|
||||||
"7": {
|
"7": {
|
||||||
"name": "Green LED",
|
"name": "Green LED",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"11": {
|
"11": {
|
||||||
"name": "Yellow LED",
|
"name": "Yellow LED",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"13": {
|
"13": {
|
||||||
"name": "Red LED",
|
"name": "Red LED",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"15": {
|
"15": {
|
||||||
"name": "Output A",
|
"name": "Output A",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"19": {
|
"19": {
|
||||||
"name": "Input D",
|
"name": "Input D",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"21": {
|
"21": {
|
||||||
"name": "Input A",
|
"name": "Input A",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"23": {
|
"23": {
|
||||||
"name": "Button",
|
"name": "Button",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"12": {
|
"12": {
|
||||||
"name": "Buzzer",
|
"name": "Buzzer",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"16": {
|
"16": {
|
||||||
"name": "Output B",
|
"name": "Output B",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"18": {
|
"18": {
|
||||||
"name": "Output C",
|
"name": "Output C",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"22": {
|
"22": {
|
||||||
"name": "Output D",
|
"name": "Output D",
|
||||||
"exclusive": "true"
|
"direction": "output",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"24": {
|
"24": {
|
||||||
"name": "Input C",
|
"name": "Input C",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
},
|
},
|
||||||
"26": {
|
"26": {
|
||||||
"name": "Input B",
|
"name": "Input B",
|
||||||
"exclusive": "true"
|
"direction": "input",
|
||||||
|
"active": "high"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,13 @@ jQuery(document).ready(function(){
|
||||||
|
|
||||||
window.prettyPrint&&prettyPrint();
|
window.prettyPrint&&prettyPrint();
|
||||||
|
|
||||||
|
$('.overlay').on('change',function(){
|
||||||
|
var url = $(this).val();
|
||||||
|
if( url != '' ){
|
||||||
|
window.location.href = url + '.html'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/*jQuery('#pages').cycle({
|
/*jQuery('#pages').cycle({
|
||||||
timeout:0,
|
timeout:0,
|
||||||
slideExpr:'article',
|
slideExpr:'article',
|
||||||
|
|
|
@ -22,8 +22,14 @@
|
||||||
<div class="latest" style="padding:10px;font-size:14px;margin-bottom:10px;text-align:right;">
|
<div class="latest" style="padding:10px;font-size:14px;margin-bottom:10px;text-align:right;">
|
||||||
Latest at Gadgetoid: <a href="http://pi.gadgetoid.com/article/parallax-propeller-p8x32a-first-impressions">Propeller ASC+, the Arduino-compatible multi-core micro: read my first impressions</a>
|
Latest at Gadgetoid: <a href="http://pi.gadgetoid.com/article/parallax-propeller-p8x32a-first-impressions">Propeller ASC+, the Arduino-compatible multi-core micro: read my first impressions</a>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="logo"><img src="{{resource_url}}pinout-logo.png" style="top:8px;" /><span>Pi</span>n<span class="out">out</span></h1>
|
<h1 class="logo"><a href="index.html"><img src="{{resource_url}}pinout-logo.png" style="top:8px;" /></a><span>Pi</span>n<span class="out">out</span></h1>
|
||||||
|
<div class="overlay">
|
||||||
|
<span>Learn more about:</span>
|
||||||
|
<select class="overlay">
|
||||||
|
<option value="">…</option>
|
||||||
|
{{overlays}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<nav id="gpio">
|
<nav id="gpio">
|
||||||
<div id="pinbase"></div>
|
<div id="pinbase"></div>
|
||||||
<div id="pinbasebplus"></div>
|
<div id="pinbasebplus"></div>
|
||||||
|
|
Loading…
Reference in New Issue