IISSSSUUEE1166--SSEEPP22001133 GGeett pprriinntteedd ccooppiieess aatt tthheemmaaggppii.ccoomm AAMMaaggaazziinneeffoorrRRaassppbbeerrrryyPPiiUUsseerrss BIGGEST ISSUE YET! 44pagesofRaspberryPigoodness USB Arduino link LLooggii--PPii FPGA Pi Matrix PATOSS Pi-Lite Bash Skutter: Expanding Java XML your senses with I2C Two competitions! Win a 512MB RaspberryPi & interfacing goodies RRaassppbbeerrrryyPPiiiissaattrraaddeemmaarrkkooffTThheeRRaassppbbeerrrryyPPiiFFoouunnddaattiioonn. hhttttpp::////wwwwww.tthheemmaaggppii.ccoomm TThhiissmmaaggaazziinneewwaassccrreeaatteedduussiinnggaaRRaassppbbeerrrryyPPiiccoommppuutteerr.
CCCooonnnttteeennntttsss SKUTTER I2C 4 Expanding yoursenses with I2C PATOSS 12 The Pato surveillance system PI MATRIX 16 Part4: Multiplexing and scrolling textmessages 9 BOOK REVIEW 20 RaspberryPi in EasySteps and Python forKids THE PI-LITE 22 Aplug and playLED matrixboard LOGI-PI SPARTAN6 FPGA BOARD 24 RaspberryPi meets FPGA USB ARDUINO LINK 28 Part2: driving an LCD AB ELECTRONICS COMPETITION 32 Win aselection ofexpansion boards THIS MONTH'S EVENTS GUIDE 33 Cambidge, CAS North London, At-Bristol, CERN FRESHLY ROASTED 34 Part2: Javacontrol-flowstatements, numbers, strings and booleans PCSL COMPETITION 39 Win aRaspberryPi Model B and accessories BASH GAFFER TAPE 40 Part3: Strings and arithmetic operations <XML /> 42 Part2: building and parsing XML in Python FEEDBACK 44 Have yoursayaboutThe MagPi http://www.themagpi.com 3.
Skutter - Expanding your senses with I2C Stephen Richards Guest Writer DIFFICULTY : ADVANCED Limitations of the GPIO a solution to all of this: something that throws open the doors to a whole galaxy of wonderful We all love the Raspberry Pi. For me the best electronic devices and sensors. This solution is thing about it, apart from its low cost and low called the I2C bus (often called the "two wire power consumption, is the General Purpose interface").
conceivable situations the master would be the Once the first address byte has been sent, only Raspberry Pi. the device with that corresponding address continues paying attention to the rest of the A tale of two wires message. All the other devices stop paying attention until the stop message sequence is On the GPIO header are two pins called SDA sent.
datasheet is the pin out diagram on page 2. description on page 5 declares this must be Make sure you look at the pin out for the correct biased externally. For normal use you can get device as several are shown. Using this diagram away with just connecting this pin directly to the we can begin to make sense of how we can positive (+ve) terminal of your power supply.
each other. This means that you can plug in the sudo halt MCP23008 and know that you are not connecting the pins on either side of the chip to each other. The gutter also makes it easy to Plug in the MCP23008 remove a microchip. You can carefully work a small flat headed screwdriver under the chip and Connect the SDA and SCL on the MCP23008 to along the gutter to lift the chip out without the corresponding GPIO connections on the bending all the pins.
#! /usr/bin/python import smbus import time address = 0x20 # Define all the registers IODIR = 0x00 IPOL = 0x01 GPINTEN = 0x02 DEFVAL = 0x03 INTCON = 0x04 IOCON = 0x05 GPPU = 0x06 INTF = 0x07 INTCAP = 0x08 GPIO = 0x09 OLAT = 0x0A bus = smbus.SMBus(1) # Change to 0 for revision 1 Raspberry Pi # Set IODIR as OUTPUT bus.write_byte_data(address, IODIR, 0b00000000) # Reset all the other registers for reg in [IPOL,GPINTEN,DEFVAL,INTCON,IOCON,GPPU,INTF,INTCAP,GPIO,OLAT]: bus.write_byte_data(address, reg, 0b00000000) # Set the GPIO's to turn on/off transistors in H-bridge. See circuit diagram.