<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sparkfun I2C GPIO expanders 2]]></title><description><![CDATA[<p dir="auto">[0_1576345075178_Qwiic_GPIO.brd](Uploading 100%) This goes with an earlier post on Sparkfun I2C GPIO expanders. A 2nd Sparkfun device is the Qwiic GPIO, SPX-14716, which uses a TCA9534 I2C chip. An advantage is that Qwiic connectors are already mounted on this device. This was an experimental board and is not directly available any more. However, Chris at the Sparkfun help desk gave me the Eagle file for the board. He will allow me to distribute it, but I don't see how to uploae it here. At <a href="https://oshpark.com/" rel="nofollow">https://oshpark.com/</a>, I was able to obtain 6 of these boards for $12.00 and the ICs from Digikey: PART: 296-47827-1-ND MFG : Texas Instruments (VA) / TCA9534DWR. Hand soldered the components an they all worked fine. Some are shown (the darker boards) in this pic:<br />
<img src="/assets/uploads/files/1576345333991-20191129_115741b-resized.jpg" alt="0_1576345370604_20191129_115741B.jpg" class="img-responsive img-markdown" />  .<br />
Python code for accessing them is here:</p>
<pre><code># adapted from &lt;https://github.com/topherCantrell/pi-io-expander/find/master&gt;

from OmegaExpansion import onionI2C #need &gt;&gt;opkg install python-light pyOnionI2C
import time

CHIP_A = 0x27 # I2C address for chip A, cut jumpers for other addresses

TC_RegDataIn =  0x00 # default 0xxx
TC_RegDataOut = 0x01 # default 0xFF
TC_RegPolInv =  0x02 # default 0x00; polarity invert
TC_RegConf =    0x03 # default 0xFF, 1 = input; 0 = output; configuration

bus = onionI2C.OnionI2C()

bus.writeByte(CHIP_A, TC_RegConf, 0xFF-0x04)  # set bit 2 as output; e.g. 1111 1011    

while True:
	
	bus.writeByte(CHIP_A, TC_RegDataOut, 4) #bit 2 on
	a = bus.readBytes(CHIP_A, TC_RegDataIn, 1)
#	print(a)
	print a[0] # a is a list even though it's only one byte
	time.sleep(0.2)

	bus.writeByte(CHIP_A, TC_RegDataOut, 0) # all off
	a = bus.readBytes(CHIP_A, TC_RegDataIn, 1)
	print a[0]
	time.sleep(0.2)
	print</code></pre>
]]></description><link>http://community.onion.io/topic/3895/sparkfun-i2c-gpio-expanders-2</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 22:09:45 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3895.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Dec 2019 17:44:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sparkfun I2C GPIO expanders 2 on Sat, 14 Dec 2019 17:44:41 GMT]]></title><description><![CDATA[<p dir="auto">[0_1576345075178_Qwiic_GPIO.brd](Uploading 100%) This goes with an earlier post on Sparkfun I2C GPIO expanders. A 2nd Sparkfun device is the Qwiic GPIO, SPX-14716, which uses a TCA9534 I2C chip. An advantage is that Qwiic connectors are already mounted on this device. This was an experimental board and is not directly available any more. However, Chris at the Sparkfun help desk gave me the Eagle file for the board. He will allow me to distribute it, but I don't see how to uploae it here. At <a href="https://oshpark.com/" rel="nofollow">https://oshpark.com/</a>, I was able to obtain 6 of these boards for $12.00 and the ICs from Digikey: PART: 296-47827-1-ND MFG : Texas Instruments (VA) / TCA9534DWR. Hand soldered the components an they all worked fine. Some are shown (the darker boards) in this pic:<br />
<img src="/assets/uploads/files/1576345333991-20191129_115741b-resized.jpg" alt="0_1576345370604_20191129_115741B.jpg" class="img-responsive img-markdown" />  .<br />
Python code for accessing them is here:</p>
<pre><code># adapted from &lt;https://github.com/topherCantrell/pi-io-expander/find/master&gt;

from OmegaExpansion import onionI2C #need &gt;&gt;opkg install python-light pyOnionI2C
import time

CHIP_A = 0x27 # I2C address for chip A, cut jumpers for other addresses

TC_RegDataIn =  0x00 # default 0xxx
TC_RegDataOut = 0x01 # default 0xFF
TC_RegPolInv =  0x02 # default 0x00; polarity invert
TC_RegConf =    0x03 # default 0xFF, 1 = input; 0 = output; configuration

bus = onionI2C.OnionI2C()

bus.writeByte(CHIP_A, TC_RegConf, 0xFF-0x04)  # set bit 2 as output; e.g. 1111 1011    

while True:
	
	bus.writeByte(CHIP_A, TC_RegDataOut, 4) #bit 2 on
	a = bus.readBytes(CHIP_A, TC_RegDataIn, 1)
#	print(a)
	print a[0] # a is a list even though it's only one byte
	time.sleep(0.2)

	bus.writeByte(CHIP_A, TC_RegDataOut, 0) # all off
	a = bus.readBytes(CHIP_A, TC_RegDataIn, 1)
	print a[0]
	time.sleep(0.2)
	print</code></pre>
]]></description><link>http://community.onion.io/post/20796</link><guid isPermaLink="true">http://community.onion.io/post/20796</guid><dc:creator><![CDATA[Yale E. Goldman]]></dc:creator><pubDate>Sat, 14 Dec 2019 17:44:41 GMT</pubDate></item></channel></rss>