Posts

Showing posts with the label gpio

Starting RPi gpio output.

Image
 Here is a little project I just started on. Have done a lot of work with a legacy Pc port. In fact, a lot of interfacing to different devices have been documented in my blogs. One thing you have to be careful of is that the pinouts vary between the different Raspberry Pi models. Here is the wiring diagram for the original RPi and for the RPi zero. An article recommends 470 ohm resisters. Not a fan of python, but there is a lot code that can be used. Python code. (railroad track warning lights.) -------------------- #Import libraries import RPi.GPIO AS GPIO import time #set gpio numbering mode and defind pins GPIO.setwarnings(False) GPIO.setmode)GPIO.BOARD) GPIO.setup(7, GPIO.OUT) GPIO.setup(11, GPIO.OUT #blink the leds for x in range(0.10):     GPIO output(7, True)     GPIO output(11, False)     time.sleep(.5)     GPIO output(7, False)     GPIO output(11, True)  ...

RPi GPIO

Image
Just a little documentation for easy access. Raspberry Pi GPIO Pinout Raspberry Pi GPIO Pinout NOTE1: The Raspberry Pi is a 3.3V device NOTE2: The GPIO pins are unbuffered and unprotected, so if you short something out, you could fry your whole Pi, so be careful! As with Revision 2 of the Rasberry Pi, there are some changes to the GPIO connector. Make sure you use the correct diagram for your board Raspberry Pi Version 1 Raspberry Pi Revision 2 Raspberry Pi B+ For full details see http://elinux.org/Rpi_Low-level_peripherals Also see: http://computoman.blogspot.com/2013/08/simple-io-for-raspberry-pi.html http://computoman.blogspot.com/2013/09/rpi-gpio-update.html http://computoman.blogspot.com/2014/11/turn-on-led-in-low-voltage-circuit.html

RPi Gpio update.

Image
  Found some of the commands on the Raspberry Pi changed a little bit The Raspberry Pi per se does not have analog ports like the Arduino. though you can get converters that can be attached to the gpio or use an r2r setup. To light an led, you will need to use at least two pins. A gpio and a ground pin. You will also need an led and an appropriate resistor. Once you master these simple steps you can additional electronics and control quite a few things. Remember the gpio only uses very low voltage. Additional safety circuitry is needed for other projects. Note: you can use jumper wires from  older computers if you do not need to use the whole header. old version -----------  # Turn light on cd /sys/class/gpio # Turn on pin but defaults to low. echo 17 > export # Set port direction, in this case we are doing output. echo out > gpio17/direction # Set pin high and turn on led. echo 1 > gpio17/value #Turn light off echo 0 > gpio17/value New versio...