From ea95c428d9113289b59b66256334cd79e7d1a109 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sat, 21 Mar 2015 23:40:38 +0000 Subject: [PATCH] Tweaked CSS, added i2c to dot3k and i2c detection, added LEDborg --- description/overlay/piborg-ledborg.md | 26 ++++++++++++++++++++++++++ description/pins/pin-27.md | 3 +++ description/pins/pin-28.md | 1 + generate-html.py | 14 ++++++++++---- overlay/display-o-tron.json | 17 +++++++++++++++++ overlay/piborg-ledborg.json | 25 +++++++++++++++++++++++++ resources/pinout.css | 3 ++- 7 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 description/overlay/piborg-ledborg.md create mode 100644 description/pins/pin-27.md create mode 120000 description/pins/pin-28.md create mode 100644 overlay/piborg-ledborg.json diff --git a/description/overlay/piborg-ledborg.md b/description/overlay/piborg-ledborg.md new file mode 100644 index 0000000..21c8742 --- /dev/null +++ b/description/overlay/piborg-ledborg.md @@ -0,0 +1,26 @@ +###The PiBorg LedBorg is an ultra-bright RGB LED board for the Raspberry Pi. + +PiBorg has its own driver, so you don't need to drive it manually. + +If you want a much, much wider range of colours, though, you can drive it manually using softPwm in WiringPi. The pin assignments for this are as follows: + +WiringPi pin 0: Red LED +WiringPi pin 2: Green LED +WiringPi pin 3: Blue LED + +This is easy using WiringPi in Python: + + +```python +import wiringpi2 as wiringpi +wiringpi.wiringPiSetup() + +wiringpi.softPwmCreate(0,0,100) +wiringpi.softPwmCreate(2,0,100) +wiringpi.softPwmCreate(3,0,100) + +# Purple! +wiringpi.softPwmWrite(3,100) # Full Blue +wiringpi.softPwmWrite(0,100) # Full Red +wiringpi.softPWMWrite(2,0) # No Green +``` \ No newline at end of file diff --git a/description/pins/pin-27.md b/description/pins/pin-27.md new file mode 100644 index 0000000..7481216 --- /dev/null +++ b/description/pins/pin-27.md @@ -0,0 +1,3 @@ +# HAT EEPROM Pins ID_SC and ID_SD + +These pins are generally reserved for i2c communication with a HAT EEPROM. \ No newline at end of file diff --git a/description/pins/pin-28.md b/description/pins/pin-28.md new file mode 120000 index 0000000..70eec8c --- /dev/null +++ b/description/pins/pin-28.md @@ -0,0 +1 @@ +pin-27.md \ No newline at end of file diff --git a/generate-html.py b/generate-html.py index 04a5453..063a369 100755 --- a/generate-html.py +++ b/generate-html.py @@ -16,6 +16,7 @@ overlays = [ 'i2c', 'arduino-spi', 'rtk-000-001', + 'piborg-ledborg', 'pibrella', 'explorer-hat-pro', 'explorer-hat', @@ -70,6 +71,12 @@ def load_overlay(overlay): if 'pin' in loaded: uses = len(loaded['pin']) details.append('* Uses {} GPIO pins'.format(uses)) + if '3' in loaded['pin'] and '5' in loaded['pin']: + pin_3 = loaded['pin']['3'] + pin_5 = loaded['pin']['5'] + if 'mode' in pin_3 and 'mode' in pin_5: + if pin_3['mode'] == 'i2c' and pin_5['mode'] == 'i2c': + details.append('* Uses I2C') if 'url' in loaded: details.append('* [More Information]({url})'.format(url=loaded['url'])) @@ -153,17 +160,16 @@ def render_pin(pin_num, selected_url, overlay=None): pin_type = list([x.strip() for x in pin['type'].lower().split('/')]) pin_url = pin['name'] pin_name = pin['name'] - pin_text_name = pin['name'] pin_used = False pin_link_title = [] if overlay != None and str(pin_num) in overlay['pin']: overlay_pin = overlay['pin'][str(pin_num)] - pin_text_name = '' - #print(overlay) - pin_name = overlay_pin['name'] pin_used = True + #print(overlay) + if 'name' in overlay_pin: + pin_name = overlay_pin['name'] if 'description' in overlay_pin: pin_link_title.append(overlay_pin['description']) diff --git a/overlay/display-o-tron.json b/overlay/display-o-tron.json index 7ec5cfe..e67746f 100644 --- a/overlay/display-o-tron.json +++ b/overlay/display-o-tron.json @@ -5,6 +5,23 @@ "description": "A 3-line character LCD with an RGB backlight and joystick", "pincount": 40, "pin": { + "3": { + "mode": "i2c" + }, + "5": { + "mode": "i2c" + }, + "19": { + "mode": "spi" + }, + "23": { + "mode": "spi" + }, + "22": { + "name": "LCD CMD/DATA", + "mode": "output", + "active": "high" + }, "7": { "name": "Joystick Button", "mode": "input", diff --git a/overlay/piborg-ledborg.json b/overlay/piborg-ledborg.json new file mode 100644 index 0000000..ccea6c4 --- /dev/null +++ b/overlay/piborg-ledborg.json @@ -0,0 +1,25 @@ +{ + "name": "PiBorg LEDBorg", + "description": "A single RGB LED for your Raspberry Pi", + "buy": "https://www.piborg.org/ledborg", + "pin": { + "11": { + "name": "Red LED", + "direction": "output", + "active": "high", + "description": "PiBorg Red LED" + }, + "13": { + "name": "Green LED", + "direction": "input", + "active": "high", + "description": "PiBorg Green LED" + }, + "15": { + "name": "Blue LED", + "direction": "output", + "active": "high", + "description": "PiBorg Blue LED" + } + } +} diff --git a/resources/pinout.css b/resources/pinout.css index cac52b7..14ba758 100644 --- a/resources/pinout.css +++ b/resources/pinout.css @@ -82,11 +82,12 @@ nav#gpio li a { display:block; width:236px; position:relative; - font-size:14px; + font-size:13px; line-height:29px; height:27px; margin-bottom:2px; } +nav#gpio li a small {font-size:11px;} nav#gpio li.overlay-pin a { background:rgba(235, 230, 211, 0.50);