From c8daedf0ee2292e2abc39d0f8e06d785595e48e4 Mon Sep 17 00:00:00 2001 From: Gabriel Freire Date: Mon, 9 Nov 2015 20:02:28 +0000 Subject: [PATCH 1/4] first commit --- src/pt-PT/index.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/pt-PT/index.md diff --git a/src/pt-PT/index.md b/src/pt-PT/index.md new file mode 100644 index 0000000..316f76a --- /dev/null +++ b/src/pt-PT/index.md @@ -0,0 +1,21 @@ +#Diagrama de Pinos! + +###O guia detalhado do diagrama de pinos GPIO do Raspberry Pi, agora com o Raspberry Pi Model B+ e Raspberry Pi 2 incluídos + +Este diagrama de pinos GPIO não foi feito com o propósito de ser imprimido mas é tanto um bom guia de referência rápida como um guia para os pinos GPIO do teu Raspberry Pi. + +##What do these numbers mean, anyway? + +* BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use with RPi.GPIO +* WiringPi - Wiring Pi pin number, for Gordon's Wiring Pi library +* Physical - Number corresponding to the pins physical location on the header + +##Pi 2 + +To celebrate the launch of the Pi 2 and the new Pi-enthusiasts it'll bring, Pinout has been updated to be cleaner, more comprehensive and more accurate and will continue to be improved. + +##Model B+ + +Now that the Raspberry Pi Model B Plus is here, I've updated Pinout with the 14 extra pins you'll find on your shiny new board. + +Note: While I've placed a gap to visually separate the additional 14 pins on the B+, you wont find this gap on the actual board! From 90343e591dc1614350982d38db897b836232dbb2 Mon Sep 17 00:00:00 2001 From: Gabriel Freire Date: Mon, 9 Nov 2015 20:14:11 +0000 Subject: [PATCH 2/4] first version of index.md translation --- src/pt-PT/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pt-PT/index.md b/src/pt-PT/index.md index 316f76a..f1642ce 100644 --- a/src/pt-PT/index.md +++ b/src/pt-PT/index.md @@ -4,18 +4,18 @@ Este diagrama de pinos GPIO não foi feito com o propósito de ser imprimido mas é tanto um bom guia de referência rápida como um guia para os pinos GPIO do teu Raspberry Pi. -##What do these numbers mean, anyway? +##O que é que estes números significam, afinal? -* BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use with RPi.GPIO -* WiringPi - Wiring Pi pin number, for Gordon's Wiring Pi library -* Physical - Number corresponding to the pins physical location on the header +* BCM - Número de pino Broadcom (Broadcom pin number), frequentemente chamados "GPIO", estes são os que provavelmente vais querer usar com o RPi.GPIO +* WiringPi - Número de pino Wiring Pi, para a biblioteca Wiring Pi de Gordon. +* Physical - Número correspondente à localização física dos pinos no cabeçalho. ##Pi 2 -To celebrate the launch of the Pi 2 and the new Pi-enthusiasts it'll bring, Pinout has been updated to be cleaner, more comprehensive and more accurate and will continue to be improved. +Para celebrar o lançamento do Pi 2 e os novos Pi-entusiastas que vai trazer, o diagrama de pinos foi atualizado para ser mais limpo, detalhado e preciso e vai continuar a ser melhorado. ##Model B+ -Now that the Raspberry Pi Model B Plus is here, I've updated Pinout with the 14 extra pins you'll find on your shiny new board. +Agora que o Raspberry Pi Model B Plus está disponível, atualizei o diagrama de pinos com os 14 pinos extras que vais encontrar na tua placa novinha em folha. -Note: While I've placed a gap to visually separate the additional 14 pins on the B+, you wont find this gap on the actual board! +Nota: Ainda que eu tenha colocado um espaço para separar visualmente os 14 pinos adicionais no B+, não vais encontrar este espaço na placa de verdade! From 64bb36c24d60d99ed917c43b271a6e55c61e415f Mon Sep 17 00:00:00 2001 From: Gabriel Freire Date: Mon, 9 Nov 2015 20:24:20 +0000 Subject: [PATCH 3/4] duplicated all the content of en-GB folder into pt-PT folder this has been done in order to make sure all of the content has been translated to pt-PT --- src/pt-PT/overlay/arduino-spi.md | 57 ++++ src/pt-PT/overlay/display-o-tron-hat.md | 44 +++ src/pt-PT/overlay/display-o-tron.md | 63 ++++ src/pt-PT/overlay/dots.md | 117 ++++++++ src/pt-PT/overlay/explorer-hat-pro.md | 115 ++++++++ src/pt-PT/overlay/explorer-hat.md | 87 ++++++ src/pt-PT/overlay/ground.md | 24 ++ src/pt-PT/overlay/i2c.md | 49 ++++ src/pt-PT/overlay/iqaudio-pi-dac.md | 50 ++++ src/pt-PT/overlay/piano-hat.md | 47 +++ src/pt-PT/overlay/piborg-ledborg.md | 48 ++++ src/pt-PT/overlay/pibrella.md | 78 +++++ src/pt-PT/overlay/piglow.md | 20 ++ src/pt-PT/overlay/rtk-000-001.md | 58 ++++ src/pt-PT/overlay/sense-hat.md | 41 +++ src/pt-PT/overlay/skywriter-hat.md | 34 +++ src/pt-PT/overlay/spi.md | 66 +++++ src/pt-PT/overlay/traffic-hat.md | 52 ++++ src/pt-PT/overlay/uart.md | 30 ++ src/pt-PT/overlay/unicorn-hat.md | 47 +++ src/pt-PT/overlay/wiringpi.md | 81 ++++++ src/pt-PT/pi-pinout.yaml | 368 ++++++++++++++++++++++++ src/pt-PT/pin/pin-1.md | 3 + src/pt-PT/pin/pin-10.md | 7 + src/pt-PT/pin/pin-12.md | 1 + src/pt-PT/pin/pin-14.md | 1 + src/pt-PT/pin/pin-2.md | 5 + src/pt-PT/pin/pin-20.md | 1 + src/pt-PT/pin/pin-25.md | 1 + src/pt-PT/pin/pin-27.md | 1 + src/pt-PT/pin/pin-28.md | 1 + src/pt-PT/pin/pin-3.md | 6 + src/pt-PT/pin/pin-30.md | 1 + src/pt-PT/pin/pin-34.md | 1 + src/pt-PT/pin/pin-39.md | 1 + src/pt-PT/pin/pin-4.md | 1 + src/pt-PT/pin/pin-5.md | 1 + src/pt-PT/pin/pin-6.md | 1 + src/pt-PT/pin/pin-8.md | 7 + src/pt-PT/pin/pin-9.md | 1 + src/pt-PT/settings.yaml | 40 +++ src/pt-PT/template/layout.html | 66 +++++ 42 files changed, 1723 insertions(+) create mode 100644 src/pt-PT/overlay/arduino-spi.md create mode 100644 src/pt-PT/overlay/display-o-tron-hat.md create mode 100644 src/pt-PT/overlay/display-o-tron.md create mode 100644 src/pt-PT/overlay/dots.md create mode 100644 src/pt-PT/overlay/explorer-hat-pro.md create mode 100644 src/pt-PT/overlay/explorer-hat.md create mode 100644 src/pt-PT/overlay/ground.md create mode 100644 src/pt-PT/overlay/i2c.md create mode 100644 src/pt-PT/overlay/iqaudio-pi-dac.md create mode 100644 src/pt-PT/overlay/piano-hat.md create mode 100644 src/pt-PT/overlay/piborg-ledborg.md create mode 100644 src/pt-PT/overlay/pibrella.md create mode 100644 src/pt-PT/overlay/piglow.md create mode 100644 src/pt-PT/overlay/rtk-000-001.md create mode 100644 src/pt-PT/overlay/sense-hat.md create mode 100644 src/pt-PT/overlay/skywriter-hat.md create mode 100644 src/pt-PT/overlay/spi.md create mode 100644 src/pt-PT/overlay/traffic-hat.md create mode 100644 src/pt-PT/overlay/uart.md create mode 100644 src/pt-PT/overlay/unicorn-hat.md create mode 100644 src/pt-PT/overlay/wiringpi.md create mode 100644 src/pt-PT/pi-pinout.yaml create mode 100644 src/pt-PT/pin/pin-1.md create mode 100644 src/pt-PT/pin/pin-10.md create mode 100644 src/pt-PT/pin/pin-12.md create mode 120000 src/pt-PT/pin/pin-14.md create mode 100644 src/pt-PT/pin/pin-2.md create mode 120000 src/pt-PT/pin/pin-20.md create mode 120000 src/pt-PT/pin/pin-25.md create mode 100644 src/pt-PT/pin/pin-27.md create mode 120000 src/pt-PT/pin/pin-28.md create mode 100644 src/pt-PT/pin/pin-3.md create mode 120000 src/pt-PT/pin/pin-30.md create mode 120000 src/pt-PT/pin/pin-34.md create mode 120000 src/pt-PT/pin/pin-39.md create mode 120000 src/pt-PT/pin/pin-4.md create mode 100644 src/pt-PT/pin/pin-5.md create mode 100644 src/pt-PT/pin/pin-6.md create mode 100644 src/pt-PT/pin/pin-8.md create mode 120000 src/pt-PT/pin/pin-9.md create mode 100644 src/pt-PT/settings.yaml create mode 100755 src/pt-PT/template/layout.html diff --git a/src/pt-PT/overlay/arduino-spi.md b/src/pt-PT/overlay/arduino-spi.md new file mode 100644 index 0000000..1841c25 --- /dev/null +++ b/src/pt-PT/overlay/arduino-spi.md @@ -0,0 +1,57 @@ + +#ATmega 328p / Arduino over SPI + +###Did you know that your Pi could power and program an ATmega 328p/Arduino directly, with nothing but a few wires, a breadboard, a 16Mhz crystal oscillator and some 22pF capacitors? + +Read my [complete Pico PiDuino tutorial](http://pi.gadgetoid.com/article/building-the-pico-piduino) to get started for just over £5 + +You'll need to install [Gordon's modified AVRDude](https://projects.drogon.net/raspberry-pi/gertboard/arduino-ide-installation-isp/). + +Connect 8/CEO to your ATmega's Reset/RST pin, 9/MISO to its MISO pin (D12), 10 to its MOSI pin (D11) and 11/SCLK to its SCLK pin (D13). + +Power your ATmega with the 3.3v and GND pins from your Pi, and you're good to go. + +Make sure you have no rogue SPI device drivers running and check it's connected correctly using: + +```bash +avrdude -p m328p -c gpio +``` + +To get started compiling Arduino sketches from the command line: + +```bash +sudo apt-get install arduino arduino-mk +``` + +This basic Makefile should get you started. Create a basic sketch, name it mysketch.ino and run: + +```bash +export BOARD=atmega328 +make +avrdude -p m328p -c gpio -e -U flash:w:build-cli/Arduino.hex +``` diff --git a/src/pt-PT/overlay/display-o-tron-hat.md b/src/pt-PT/overlay/display-o-tron-hat.md new file mode 100644 index 0000000..c875db2 --- /dev/null +++ b/src/pt-PT/overlay/display-o-tron-hat.md @@ -0,0 +1,44 @@ + +#Display-o-Tron HAT + +Display-o-Tron HAT uses both SPI and I2c to drive the LCD display, backlight and touch. +However both of these busses can be shared with other devices. + +You can use the one-line product installer to get Display-o-Tron HAT set up and ready to go, just: + +```bash +curl get.pimoroni.com/dot3k | bash +``` + +And follow the instructions! diff --git a/src/pt-PT/overlay/display-o-tron.md b/src/pt-PT/overlay/display-o-tron.md new file mode 100644 index 0000000..b0fbac9 --- /dev/null +++ b/src/pt-PT/overlay/display-o-tron.md @@ -0,0 +1,63 @@ + +#Display-o-Tron 3000 + +You can use the one-line product installer to get Display-o-Tron 3000 set up and ready to go, just: + +```bash +curl get.pimoroni.com/dot3k | bash +``` + +And follow the instructions! diff --git a/src/pt-PT/overlay/dots.md b/src/pt-PT/overlay/dots.md new file mode 100644 index 0000000..e577c39 --- /dev/null +++ b/src/pt-PT/overlay/dots.md @@ -0,0 +1,117 @@ + +#Raspberry Pi Dots + +###Dots is a Dot to Dot HAT board for the Raspberry Pi that lets you join-the-dots with BARE Conductive Paint! + +Every Dot on the Dots board is a "floating" metal contact just waiting to be pulled down to ground with a dab of paint. + +To read a Dot you should set its corresponding pin as an INPUT and make sure it's pulled up like so: + +```python +import RPi.GPIO as GPIO +GPIO.setmode(GPIO.BCM ) +GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) +state = GPIO.input(dot_pin) +``` + +It's good practise to only turn on the PULLUP when you actually want to read the Dot, so a method like +this is recommended for reading: + +```python +def is_dot_connected(dot_pin): + GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) + state = GPIO.input( dot_pin ) + GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_OFF) + return state == 0 +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/explorer-hat-pro.md b/src/pt-PT/overlay/explorer-hat-pro.md new file mode 100644 index 0000000..b233bce --- /dev/null +++ b/src/pt-PT/overlay/explorer-hat-pro.md @@ -0,0 +1,115 @@ + +#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. + +```bash +sudo apt-get install python-pip +sudo pip install explorer-hat +``` + +Then import it into your Python script and start tinkering: + +```bash +import explorerhat +explorerhat.light.on() +``` diff --git a/src/pt-PT/overlay/explorer-hat.md b/src/pt-PT/overlay/explorer-hat.md new file mode 100644 index 0000000..5669293 --- /dev/null +++ b/src/pt-PT/overlay/explorer-hat.md @@ -0,0 +1,87 @@ + +#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. + +```bash +sudo apt-get install python-pip +sudo pip install explorer-hat +``` + +Then import it into your Python script and start tinkering: + +```bash +import explorerhat +explorerhat.light.on() +``` diff --git a/src/pt-PT/overlay/ground.md b/src/pt-PT/overlay/ground.md new file mode 100644 index 0000000..ff29f4b --- /dev/null +++ b/src/pt-PT/overlay/ground.md @@ -0,0 +1,24 @@ + +#Ground + +The Ground pins on the Raspberry Pi are all electrically connected, so it doesn't matter +which one you use if you're wiring up a voltage supply. + +Generally the one that's most convenient or closest to the rest of your connections is tidier +and easier, or alternatively the one closest to the supply pin that you use. + +It's a good idea to use Physical Pin 17 for 3v3 and Physical Pin 25 for ground when using +the [SPI](/pinout/spi) connections, for example, as these are right next to the important pins for SPI0. diff --git a/src/pt-PT/overlay/i2c.md b/src/pt-PT/overlay/i2c.md new file mode 100644 index 0000000..5e9e0ee --- /dev/null +++ b/src/pt-PT/overlay/i2c.md @@ -0,0 +1,49 @@ + +#I2C - Inter Integrated Circuit + +The Raspberry Pi's I2C pins are an extremely useful way to talk to many different types of external peripheral; from the MCP23017 digital IO expander, to a connected ATmega. + +You can verify the address of connected I2C peripherals with a simple one-liner: + +```bash +sudo apt-get install i2c-tools +sudo i2cdetect -y 1 +``` + +You can access i2c from Python using the smbus library: + +```bash +sudo apt-get install python-smbus +``` + +And then in Python: + +```python +import smbus +DEVICE_BUS = 1 +DEVICE_ADDR = 0x15 +bus = smbus.SMBus(DEVICE_BUS) +bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01) +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/iqaudio-pi-dac.md b/src/pt-PT/overlay/iqaudio-pi-dac.md new file mode 100644 index 0000000..cbb83a0 --- /dev/null +++ b/src/pt-PT/overlay/iqaudio-pi-dac.md @@ -0,0 +1,50 @@ + +#IQaudIO Pi-DAC+ + +The Pi-DAC+ takes the digital audio signals (I2S) from the Raspberry Pi and through the +onboard Texas Instruments PCM5122 DAC delivers variable output (hardware volume +control) analog audio to the Pi-DAC+ Phono connectors. The PI-DAC+ also, via the +Texas Instruments TPA6133A headphone amp, supports the direct use of headphones via +the Pi-DAC+ 3.5mm audio jack. + +The Pi Dac uses GPIO22 to mute/unmute the Pi-AMP+. + +You can use GPIO25 to connect an IR sensor and GPIO23/24 for a rotary encoder. Both of +these parts are optional, but are broken out on the Pi-DAC+ for convenient access. + +Note: pins reserved for the rotary encoder and IR sensor can be used for other purposes if those add-ons have not been fitted and enabled by software. diff --git a/src/pt-PT/overlay/piano-hat.md b/src/pt-PT/overlay/piano-hat.md new file mode 100644 index 0000000..2e274a8 --- /dev/null +++ b/src/pt-PT/overlay/piano-hat.md @@ -0,0 +1,47 @@ + +#Piano HAT + +Piano HAT has 16 touch-sensitive buttons. 13 of these are a single Piano octave, the rest give you octave up/down and instrument select functionality. + +It uses two Microchip CAP1188 chips with the i2c addresses 0x28 and 0x2b. + +You can use the one-line product installer to get Piano HAT set up and ready to go, just: + +```bash +curl get.pimoroni.com/pianohat | bash +``` + +And follow the instructions! diff --git a/src/pt-PT/overlay/piborg-ledborg.md b/src/pt-PT/overlay/piborg-ledborg.md new file mode 100644 index 0000000..1020280 --- /dev/null +++ b/src/pt-PT/overlay/piborg-ledborg.md @@ -0,0 +1,48 @@ + +###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/src/pt-PT/overlay/pibrella.md b/src/pt-PT/overlay/pibrella.md new file mode 100644 index 0000000..3e2abfd --- /dev/null +++ b/src/pt-PT/overlay/pibrella.md @@ -0,0 +1,78 @@ + +#Pibrella + +The all-in-one light, sound, input and output add-on board from Pimoroni vs Cyntech uses lots of IO on the Pi but leaves both Serial and I2C free leaving plenty of room for expansion if you get creative. + +Pibrella is easy to use, first you should install the module using LXTerminal/Command Line: + +```bash +sudo apt-get install python-pip +sudo pip install pibrella +``` + +Then import it into your Python script and start tinkering: + +```bash +import pibrella +pibrella.light.red.on() +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/piglow.md b/src/pt-PT/overlay/piglow.md new file mode 100644 index 0000000..3344b8c --- /dev/null +++ b/src/pt-PT/overlay/piglow.md @@ -0,0 +1,20 @@ + +#PiGlow \ No newline at end of file diff --git a/src/pt-PT/overlay/rtk-000-001.md b/src/pt-PT/overlay/rtk-000-001.md new file mode 100644 index 0000000..4320cb0 --- /dev/null +++ b/src/pt-PT/overlay/rtk-000-001.md @@ -0,0 +1,58 @@ + +#Ryanteck Motor Controller Board + +###A quick and easy way to start driving motors on your Raspberry Pi + +```python +##Simple motor script for the RTK-000-001 +import RPi.GPIO as GPIO +import time +#Set to broadcom pin numbers +GPIO.setmode(GPIO.BCM) + +#Motor 1 = Pins 17 and 18 +#Motor 2 = Pins 22 and 23 +GPIO.setup(17, GPIO.OUT) +GPIO.setup(18, GPIO.OUT) + +#Now loop forever turning one direction for 5 seconds, then the other +while (True): + #Sleep 1 second then turn 17 on + GPIO.output(18, 0) + time.sleep(1) + GPIO.output(17, 1); + time.sleep(5); + #And now the other way round + GPIO.output(17, 0) + time.sleep(1); + GPIO.output(18, 1); + time.sleep(5); + #And loop back around +#And final cleanup +GPIO.cleanup() +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/sense-hat.md b/src/pt-PT/overlay/sense-hat.md new file mode 100644 index 0000000..5e04134 --- /dev/null +++ b/src/pt-PT/overlay/sense-hat.md @@ -0,0 +1,41 @@ + +#Sense HAT + +LED Matrix: LED2472G -> ATTINY88 -> SPI +Joystick: SKRHABE010 -> ATTINY88 -> GPIO23/24/25 +Axis/IMU: LSM9DS1 -> i2c 0x1c(1e),0x6a(6b) (INT on MCU) +Pressure/Temp: LPS25H -> i2c 0x5c +Humidity/Temp: HTS221 -> i2c 0x5f \ No newline at end of file diff --git a/src/pt-PT/overlay/skywriter-hat.md b/src/pt-PT/overlay/skywriter-hat.md new file mode 100644 index 0000000..f6f3e7d --- /dev/null +++ b/src/pt-PT/overlay/skywriter-hat.md @@ -0,0 +1,34 @@ + +#Skywriter HAT + +Skywriter HAT senses your finger's position above it in 3 dimensions, outputting an X, Y, Z axis +which you can use in your Python scripts. + +It also recognises gestures, including swipes and more. diff --git a/src/pt-PT/overlay/spi.md b/src/pt-PT/overlay/spi.md new file mode 100644 index 0000000..2424228 --- /dev/null +++ b/src/pt-PT/overlay/spi.md @@ -0,0 +1,66 @@ + +#SPI - Serial Peripheral Interface + +###Known as the four-wire serial bus, SPI lets you daisy-chain multiple compatible devices off a single set of pins by assigning them different chip-select pins. + +A useful example of an SPI peripheral is the MCP23S17 digital IO expander chip Note the S in place of the 0 found on the I2C version. + +To talk to an SPI device, you assert its corresponding chip-select pin. By default the Pi has CE0 and CE1. + +```python +import spidev + +spi = spidev.SpiDev() +spi.open(0, CHIP_SELECT_0_OR_1) +spi.max_speed_hz = 1000000 +spi.xfer([value_8bit]) +``` + +You can also use the SPI port to "Bit-Bang" an ATmega 328, loading Arduino sketches onto it with Gordon's modified version of AVRDude. + +Hook up you Pi's SPI port to that of your ATmega, and power the ATmega from the 3.3v pin on the Pi. Make sure you're not running any SPI device drivers, and run "avrdude -p m328p -c gpio" to verify the connection. + +See the individual pins to learn how to connect up your ATmega. \ No newline at end of file diff --git a/src/pt-PT/overlay/traffic-hat.md b/src/pt-PT/overlay/traffic-hat.md new file mode 100644 index 0000000..4fa0a03 --- /dev/null +++ b/src/pt-PT/overlay/traffic-hat.md @@ -0,0 +1,52 @@ + +#Traffic HAT + +###A quick and easy way to learn the basics of GPIO on a budget. All in a nice HAT. + +```python +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) + +#Buzzer +IO.setup(5,IO.OUT) + +#Button +IO.setup(25,IO.IN,pull_up_down=IO.PUD_UP) +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/uart.md b/src/pt-PT/overlay/uart.md new file mode 100644 index 0000000..dde34a7 --- /dev/null +++ b/src/pt-PT/overlay/uart.md @@ -0,0 +1,30 @@ + +#UART - Universal Asynchronous Receiver/Transmitter + +###The 2 UART pins in WiringPi are: 15, 16 + +UART is a handy, straight forward way to interface an Arduino ( or bootloaded ATmega ) with your Pi. You must, however, be careful with logic-levels between the two devices: the Pi is 3.3v and the Arduino is 5v. Connect the two and you might conjure up some magic blue smoke. + +Personally I'm a fan of building out a Arduino Bootloaded ATmega 328 circuit on a breadboard with a voltage regulator to take the Pi's 5v line and convert it to 3.3v. The ATmega 328 seems to run quite happily at 3.3v using a 16Mhz crystal and you'll then have an Arduino clone with 3.3v logic. + +Assuming you have WiringPi2-Python installed, the following python example opens the Pi's UART at 9600baud and puts 'hello world' + +```python +import wiringpi2 as wiringpi +wiringpi.wiringPiSetup() +serial = wiringpi.serialOpen('/dev/ttyAMA0',9600) +wiringpi.serialPuts(serial,'hello world!') +``` \ No newline at end of file diff --git a/src/pt-PT/overlay/unicorn-hat.md b/src/pt-PT/overlay/unicorn-hat.md new file mode 100644 index 0000000..c3c4013 --- /dev/null +++ b/src/pt-PT/overlay/unicorn-hat.md @@ -0,0 +1,47 @@ + +#Unicorn HAT + +64 blindingly bright LEDs packed into a HAT and driven with an ultra-fast, C library that you can talk to +from Python make Unicorn HAT PiGlow's bigger, brighter brother. + +Note: Unicorn HAT uses some special PWM trickery, performed with the same hardware that lets you Pi produce sound +through the audio jack ( analog audio ) so you can't use both at the same time! + +Setup is easy, just: + +```bash +curl get.pimoroni.com/unicornhat | bash +``` + +Then import it into your Python script and start tinkering: + +```bash +import unicornhat +unicornhat.set_pixel(0, 0, 255, 255, 255) +unicornhat.show() +``` diff --git a/src/pt-PT/overlay/wiringpi.md b/src/pt-PT/overlay/wiringpi.md new file mode 100644 index 0000000..1a2e5db --- /dev/null +++ b/src/pt-PT/overlay/wiringpi.md @@ -0,0 +1,81 @@ + +#Raspberry Pi WiringPi + +###WiringPi is an attempt to bring Arduino-wiring-like simplicity to the Raspberry Pi. + +The goal is to have a single common platform and set of functions for accessing the Raspberry Pi GPIO across muliple languages. WiringPi is a C library at heart, but it's available to both Ruby and Python users who can "gem install wiringpi" or "pip install wiringpi2" respectively. + +Python users note the 2 on the end, the WiringPi2-Python library finally brings a whole host of existing WiringPi functionality to Python including brand new features from WiringPi 2. + +For more information about WiringPi you should visit the official WiringPi website. + +##Getting started with WiringPi + +WiringPi uses its own pin numbering scheme, here you'll learn how WiringPi numbers your GPIO pins, what those pins do and how to do shiny things with them from within Python or Ruby. + +WiringPi, the Arduino-like GPIO library for the Pi, is available in C right from Gordon's git repository, Python, Ruby and even Perl and PHP to a lesser extent. + +Installing to Python couldn't be easier, just: + +```bash +sudo pip install wiringpi2 +``` + +Note the 2 on the end? That's the all new, shinier WiringPi! \ No newline at end of file diff --git a/src/pt-PT/pi-pinout.yaml b/src/pt-PT/pi-pinout.yaml new file mode 100644 index 0000000..7a9d98f --- /dev/null +++ b/src/pt-PT/pi-pinout.yaml @@ -0,0 +1,368 @@ +--- +name: Raspberry Pi GPIO Pinout +pins: + '1': + name: 3v3 Power + type: "+3v3" + '2': + name: 5v Power + type: "+5v" + '3': + name: SDA + description: I2C Data + type: GPIO/I2C + scheme: + wiringpi: 8 + bcm: 2 + bcmAlt: 0 + functions: + alt0: SDA1 + alt1: SA3 + '4': + name: 5v Power + type: "+5v" + '5': + name: SCL + description: I2C Clock + type: GPIO/I2C + scheme: + wiringpi: 9 + bcm: 3 + bcmAlt: 1 + functions: + alt0: SCL1 + alt1: SA2 + '6': + name: Ground + type: GND + '7': + name: GPCLK0 + type: GPIO + scheme: + wiringpi: 7 + bcm: 4 + functions: + alt0: GPCLK0 + alt1: SA1 + alt5: ARM_TDI + '8': + name: TXD + description: UART Transmit + type: GPIO/UART + scheme: + wiringpi: 15 + bcm: 14 + functions: + alt0: TXD0 + alt1: SD6 + alt2: Reserved + alt5: TXD1 + '9': + name: Ground + type: GND + '10': + name: RXD + description: UART Receive + type: GPIO/UART + scheme: + wiringpi: 16 + bcm: 15 + functions: + alt0: RXD0 + alt1: SD7 + alt2: Reserved + alt5: RXD1 + '11': + name: '' + type: GPIO + scheme: + wiringpi: 0 + bcm: 17 + functions: + alt0: Reserved + alt1: SD9 + alt2: Reserved + alt3: RTS0 + alt4: SPI1_CE1_N + alt5: RTS1 + '12': + name: PCM_C + description: PCM Clock + type: GPIO + scheme: + wiringpi: 1 + bcm: 18 + functions: + alt0: PCM_CLK + alt1: SD10 + alt2: Reserved + alt3: BSCSL SDA / MOSI + alt4: SPI1_CE0_N + alt5: PWM0 + '13': + name: PCM_D + type: GPIO + scheme: + wiringpi: 2 + bcm: 27 + bcmAlt: 21 + functions: + alt0: Reserved + alt1: Reserved + alt2: Reserved + alt3: SD1_DAT3 + alt4: ARM_TMS + '14': + name: Ground + type: GND + '15': + name: '' + type: GPIO + scheme: + wiringpi: 3 + bcm: 22 + functions: + alt0: Reserved + alt1: SD14 + alt2: Reserved + alt3: SD1_CLK + alt4: ARM_TRST + '16': + name: '' + type: GPIO + scheme: + wiringpi: 4 + bcm: 23 + functions: + alt0: Reserved + alt1: SD15 + alt2: Reserved + alt3: SD1_CMD + alt4: ARM_RTCK + '17': + name: 3v3 Power + type: "+3v3" + '18': + name: '' + type: GPIO + scheme: + wiringpi: 5 + bcm: 24 + functions: + alt0: Reserved + alt1: SD16 + alt2: Reserved + alt3: SD1_DAT0 + alt4: ARM_TDO + '19': + name: MOSI + type: GPIO/SPI + scheme: + wiringpi: 12 + bcm: 10 + functions: + alt0: SPI0_MOSI + alt1: SD2 + alt2: Reserved + '20': + name: Ground + type: GND + '21': + name: MISO + type: GPIO/SPI + scheme: + wiringpi: 13 + bcm: 9 + functions: + alt0: SPI0_MISO + alt1: SD1 + alt2: Reserved + '22': + name: '' + type: GPIO + scheme: + wiringpi: 6 + bcm: 25 + functions: + alt0: Reserved + alt1: SD17 + alt2: Reserved + alt3: SD1_DAT1 + alt4: ARM_TCK + '23': + name: SCLK + type: GPIO/SPI + scheme: + wiringpi: 14 + bcm: 11 + functions: + alt0: SPI0_SCLK + alt1: SD3 + alt2: Reserved + '24': + name: CE0 + description: SPI Chip Select 0 + type: GPIO/SPI + scheme: + wiringpi: 10 + bcm: 8 + functions: + alt0: SPI0_CE0_N + alt1: SD0 + alt2: Reserved + '25': + name: Ground + type: GND + '26': + name: CE1 + description: SPI Chip Select 1 + type: GPIO/SPI + scheme: + wiringpi: 11 + bcm: 7 + functions: + alt0: SPI0_CE1_N + alt1: SWE_N / SRW_N + alt2: Reserved + '27': + name: ID_SD + description: HAT EEPROM i2c Data + type: GPIO/I2C + scheme: + wiringpi: 30 + bcm: 0 + functions: + alt0: SDA0 + alt1: SA5 + alt2: Reserved + '28': + name: ID_SC + description: HAT EEPROM i2c Clock + type: GPIO/I2C + scheme: + wiringpi: 31 + bcm: 1 + functions: + alt0: SCL0 + alt1: SA4 + alt2: Reserved + '29': + name: '' + type: GPIO + scheme: + wiringpi: 21 + bcm: 5 + functions: + alt0: GPCLK1 + alt1: SA0 + alt2: Reserved + alt5: ARM_TDO + '30': + name: Ground + type: GND + '31': + name: '' + type: GPIO + scheme: + wiringpi: 22 + bcm: 6 + functions: + alt0: GPCLK2 + alt1: SOE_N / SE + alt2: Reserved + alt5: ARM_RTCK + '32': + name: '' + type: GPIO + scheme: + wiringpi: 26 + bcm: 12 + functions: + alt0: PWM0 + alt1: SD4 + alt2: Reserved + alt5: ARM_TMS + '33': + name: '' + type: GPIO + scheme: + wiringpi: 23 + bcm: 13 + functions: + alt0: PWM1 + alt1: SD5 + alt2: Reserved + alt5: ARM_TCK + '34': + name: Ground + type: GND + '35': + name: MISO + description: SPI Master-In + type: GPIO/SPI + scheme: + wiringpi: 24 + bcm: 19 + functions: + alt0: PCM_FS + alt1: SD11 + alt2: Reserved + alt3: BSCSL SCL / SCLK + alt4: SPI1_MISO + alt5: PWM1 + '36': + name: '' + type: GPIO + scheme: + wiringpi: 27 + bcm: 16 + functions: + alt0: Reserved + alt1: SD8 + alt2: Reserved + alt3: CTS0 + alt4: SPI1_CE2_N + alt5: CTS1 + '37': + name: '' + type: GPIO + scheme: + wiringpi: 25 + bcm: 26 + functions: + alt0: Reserved + alt1: Reserved + alt2: Reserved + alt3: SD1_DAT2 + alt4: ARM_TDI + '38': + name: MOSI + description: SPI Master-Out + type: GPIO/SPI + scheme: + wiringpi: 28 + bcm: 20 + functions: + alt0: PCM_DIN + alt1: SD12 + alt2: Reserved + alt3: BSCSL / MISO + alt4: SPI1_MOSI + alt5: CPCLK0 + '39': + name: Ground + type: GND + '40': + name: SCLK + description: SPI Clock + type: GPIO/SPI + scheme: + wiringpi: 29 + bcm: 21 + functions: + alt0: PCM_DOUT + alt1: SD13 + alt2: Reserved + alt3: BSCSL / CE_N + alt4: SPI1_SCLK + alt5: GPCLK1 diff --git a/src/pt-PT/pin/pin-1.md b/src/pt-PT/pin/pin-1.md new file mode 100644 index 0000000..f83da60 --- /dev/null +++ b/src/pt-PT/pin/pin-1.md @@ -0,0 +1,3 @@ +###The 3v3, 3.3 volt, supply pin on the Pi has a max available current of about 50 mA. Enough to power a couple of LEDs or a microprocessor, but not much more. + +You should generally use the 5v supply, coupled with a 3v3 regulator for 3.3v projects. diff --git a/src/pt-PT/pin/pin-10.md b/src/pt-PT/pin/pin-10.md new file mode 100644 index 0000000..d15a969 --- /dev/null +++ b/src/pt-PT/pin/pin-10.md @@ -0,0 +1,7 @@ +This pin doubles up as the UART recieve pin, RXD. It's also commonly known as "Serial" and, by default, will output a Console from your Pi that, with a suitable Serial cable, you can use to control your Pi via the command-line. + +Thus, The UART pins are useful for setting up a "headless" Pi (a Pi without a screen) and getting it connected to a network. + +UART can also be extremely useful if you want to talk to Arduino or Propeller boards from your Pi, but you must make sure you disable the Serial Console in raspi-config first. + +[Learn more about UART](/pinout/uart) \ No newline at end of file diff --git a/src/pt-PT/pin/pin-12.md b/src/pt-PT/pin/pin-12.md new file mode 100644 index 0000000..1dee236 --- /dev/null +++ b/src/pt-PT/pin/pin-12.md @@ -0,0 +1 @@ +The PWM0 output of BCM 18 is particularly useful, in combination with some fast, direct memory access trickery, for driving tricky devices with very specific timings. The WS2812 LEDs on the [Unicorn HAT](/pinout/unicorn_hat) are a good example of this in action. \ No newline at end of file diff --git a/src/pt-PT/pin/pin-14.md b/src/pt-PT/pin/pin-14.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-14.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-2.md b/src/pt-PT/pin/pin-2.md new file mode 100644 index 0000000..a5ea7cb --- /dev/null +++ b/src/pt-PT/pin/pin-2.md @@ -0,0 +1,5 @@ +###The 5v power pins are connected directly to the Pi's power input and will capably provide the full current of your mains adaptor, less that used by the Pi itself. + +With a decent power supply, such as the official Pi adaptor, you can expect to pull about 1.5A. + +Don't be disuaded by what sounds like a measly low voltage. You can do a lot with 5v. Power Arduinos, and even run a small Electroluminescent wire inverter right off the 5v pin! diff --git a/src/pt-PT/pin/pin-20.md b/src/pt-PT/pin/pin-20.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-20.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-25.md b/src/pt-PT/pin/pin-25.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-25.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-27.md b/src/pt-PT/pin/pin-27.md new file mode 100644 index 0000000..1aa0b3e --- /dev/null +++ b/src/pt-PT/pin/pin-27.md @@ -0,0 +1 @@ +These pins are generally reserved for i2c communication with a HAT EEPROM. \ No newline at end of file diff --git a/src/pt-PT/pin/pin-28.md b/src/pt-PT/pin/pin-28.md new file mode 120000 index 0000000..70eec8c --- /dev/null +++ b/src/pt-PT/pin/pin-28.md @@ -0,0 +1 @@ +pin-27.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-3.md b/src/pt-PT/pin/pin-3.md new file mode 100644 index 0000000..0c066d9 --- /dev/null +++ b/src/pt-PT/pin/pin-3.md @@ -0,0 +1,6 @@ +SDA is one of the i2c pins on the Pi, [learn more about i2c](/pinout/i2c). + +It's easy to get started writing a digital HIGH or LOW to a GPIO pin, but you've got to remember a few things: + +* Run your script as root +* Set your pin's mode to OUTPUT (1) diff --git a/src/pt-PT/pin/pin-30.md b/src/pt-PT/pin/pin-30.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-30.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-34.md b/src/pt-PT/pin/pin-34.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-34.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-39.md b/src/pt-PT/pin/pin-39.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-39.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-4.md b/src/pt-PT/pin/pin-4.md new file mode 120000 index 0000000..253c8f3 --- /dev/null +++ b/src/pt-PT/pin/pin-4.md @@ -0,0 +1 @@ +pin-2.md \ No newline at end of file diff --git a/src/pt-PT/pin/pin-5.md b/src/pt-PT/pin/pin-5.md new file mode 100644 index 0000000..620c306 --- /dev/null +++ b/src/pt-PT/pin/pin-5.md @@ -0,0 +1 @@ +SCL is one of the i2c pins on the Pi, [learn more about i2c](/pinout/i2c). \ No newline at end of file diff --git a/src/pt-PT/pin/pin-6.md b/src/pt-PT/pin/pin-6.md new file mode 100644 index 0000000..e3458e6 --- /dev/null +++ b/src/pt-PT/pin/pin-6.md @@ -0,0 +1 @@ +Ground! \ No newline at end of file diff --git a/src/pt-PT/pin/pin-8.md b/src/pt-PT/pin/pin-8.md new file mode 100644 index 0000000..61500e3 --- /dev/null +++ b/src/pt-PT/pin/pin-8.md @@ -0,0 +1,7 @@ +This pin doubles up as the UART transmit pin, TXD. It's also commonly known as "Serial" and, by default, will output a Console from your Pi that, with a suitable Serial cable, you can use to control your Pi via the command-line. + +Thus, The UART pins are useful for setting up a "headless" Pi (a Pi without a screen) and getting it connected to a network. + +UART can also be extremely useful if you want to talk to Arduino or Propeller boards from your Pi, but you must make sure you disable the Serial Console in raspi-config first. + +[Learn more about UART](/pinout/uart) \ No newline at end of file diff --git a/src/pt-PT/pin/pin-9.md b/src/pt-PT/pin/pin-9.md new file mode 120000 index 0000000..d0abe28 --- /dev/null +++ b/src/pt-PT/pin/pin-9.md @@ -0,0 +1 @@ +pin-6.md \ No newline at end of file diff --git a/src/pt-PT/settings.yaml b/src/pt-PT/settings.yaml new file mode 100644 index 0000000..b4d3abf --- /dev/null +++ b/src/pt-PT/settings.yaml @@ -0,0 +1,40 @@ +--- +default_desc: The comprehensive Raspberry Pi GPIO Pinout guide for the original Raspberry + Pi, B+ and Pi 2 +default_title: Raspberry Pi GPIO Pinout - Pi 1, B+, Pi 2 +title_suffix: " at Raspberry Pi GPIO Pinout" +base_url: /pinout/ +resource_url: /resources/ +domain: pinout.xyz +url_suffix: +urls: + GND: ground +strings: +- made_by: '* Made by {manufacturer}' +- type_hat: '* HAT form-factor' +- type_classic: '* Classic form-factor' +- pin_header: '* {} pin header' +- uses_i2c: '* Uses I2C' +- wiring_pi_pin: 'Wiring Pi pin {}' +overlays: +- ground +- spi +- uart +- i2c +- wiringpi +- arduino-spi +- rtk-000-001 +- piborg-ledborg +- piglow +- pibrella +- unicorn-hat +- skywriter-hat +- explorer-hat-pro +- explorer-hat +- display-o-tron +- display-o-tron-hat +- dots +- traffic-hat +- iqaudio-pi-dac +- piano-hat +- sense-hat diff --git a/src/pt-PT/template/layout.html b/src/pt-PT/template/layout.html new file mode 100755 index 0000000..8459510 --- /dev/null +++ b/src/pt-PT/template/layout.html @@ -0,0 +1,66 @@ + + + + {{title}} + + + + + + + + {{hreflang}} + + + +
+ +

Raspberry Pinout

+
+ Learn about Pi pins and add-ons + +
+ +
+
+ {{content}} +
+
+ +
+ + + + + + + + + From 4544702f80a008b67c9aeea8ded5222d07c37c29 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Fri, 20 Nov 2015 00:36:53 +0000 Subject: [PATCH 4/4] Small refactoring of the pin conversion functions --- pinout.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/pinout.py b/pinout.py index 6e73b07..9e320be 100644 --- a/pinout.py +++ b/pinout.py @@ -24,29 +24,33 @@ def render_html(*args, **kwargs): def bcm_to_physical(pin): - for idx in pins: - compare_pin = pins[idx] - if 'scheme' in compare_pin: - if 'bcm' in compare_pin['scheme']: - if compare_pin['scheme']['bcm'] == int(pin): - #print("Mapping BCM{} to {}".format(pin, str(idx))) - return str(idx) + return physical_from(pin, 'bcm') + + +def wiringpi_to_physical(pin): + return physical_from(pin, 'wiringpi') + + +def physical_from(pin, scheme='bcm'): + if scheme in ['bcm', 'wiringpi']: + for idx in pins: + compare_pin = pins[idx] + if 'scheme' in compare_pin: + if scheme in compare_pin['scheme']: + if compare_pin['scheme'][scheme] == int(pin): + #print("Mapping {}{} to {}".format(scheme, pin, str(idx))) + return str(idx) + elif scheme == 'physical': + return pin + return None def physical_to_bcm(pin): - pin = pins[pin] - if 'scheme' in pin: - if 'bcm' in pin['scheme']: - return str(pin['scheme']['bcm']) - return None + return physical_to(pin, 'bcm') def physical_to_wiringpi(pin): - pin = pins[pin] - if 'scheme' in pin: - if 'wiringpi' in pin['scheme']: - return str(pin['scheme']['wiringpi']) - return None + return physical_to(pin, 'wiringpi') def physical_to(pin, scheme='bcm'):