<?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[pcf8591-adc-via-i2c]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/3028/incorrect-readings-from-pcf8591-adc-via-i2c">Incorrect readings from PCF8591 ADC via I2C</a><br />
Sorry as much as I try to follow the example does not work or at least does not show the same results I built this, but I do not see where I screwed up</p>
<p dir="auto">#!/usr/bin/env python</p>
<p dir="auto">from OmegaExpansion import onionI2C<br />
import time<br />
import curses</p>
<h1>2014-08-26 <a href="http://PCF8591-x.py" rel="nofollow">PCF8591-x.py</a></h1>
<h1>Connect Pi 3V3 - VCC, Ground - Ground, SDA - SDA, SCL - SCL.</h1>
<h1>./PCF8591-x.py</h1>
<p dir="auto">bus = onionI2C.OnionI2C()</p>
<p dir="auto">stdscr = curses.initscr()<br />
curses.noecho()<br />
curses.cbreak()<br />
aout = 0</p>
<p dir="auto">stdscr.addstr(10, 0, "Brightness")<br />
stdscr.addstr(12, 0, "Temperature")<br />
stdscr.addstr(14, 0, "AOUT-&gt;AIN2")<br />
stdscr.addstr(16, 0, "Resistor")</p>
<p dir="auto">stdscr.nodelay(1)</p>
<p dir="auto">try:<br />
while True:</p>
<pre><code>  for a in range(0,4):
     aout = aout + 1
     bus.writebytes(0x48,0x40 | ((a+1) &amp; 0x03), aout)
     v = bus.readbyte(0x48)
     hashes = v / 4
     spaces = 64 - hashes
     stdscr.addstr(10+a*2, 12, str(v) + ' ')
  stdscr.refresh()
  time.sleep(0.04)

  c = stdscr.getch()

  if c != curses.ERR:
     break
</code></pre>
<p dir="auto">except:<br />
pass</p>
<p dir="auto">curses.nocbreak()<br />
curses.echo()<br />
curses.endwin()</p>
]]></description><link>http://community.onion.io/topic/3605/pcf8591-adc-via-i2c</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 10:53:47 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3605.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 May 2019 21:16:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to pcf8591-adc-via-i2c on Tue, 21 May 2019 21:16:22 GMT]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/3028/incorrect-readings-from-pcf8591-adc-via-i2c">Incorrect readings from PCF8591 ADC via I2C</a><br />
Sorry as much as I try to follow the example does not work or at least does not show the same results I built this, but I do not see where I screwed up</p>
<p dir="auto">#!/usr/bin/env python</p>
<p dir="auto">from OmegaExpansion import onionI2C<br />
import time<br />
import curses</p>
<h1>2014-08-26 <a href="http://PCF8591-x.py" rel="nofollow">PCF8591-x.py</a></h1>
<h1>Connect Pi 3V3 - VCC, Ground - Ground, SDA - SDA, SCL - SCL.</h1>
<h1>./PCF8591-x.py</h1>
<p dir="auto">bus = onionI2C.OnionI2C()</p>
<p dir="auto">stdscr = curses.initscr()<br />
curses.noecho()<br />
curses.cbreak()<br />
aout = 0</p>
<p dir="auto">stdscr.addstr(10, 0, "Brightness")<br />
stdscr.addstr(12, 0, "Temperature")<br />
stdscr.addstr(14, 0, "AOUT-&gt;AIN2")<br />
stdscr.addstr(16, 0, "Resistor")</p>
<p dir="auto">stdscr.nodelay(1)</p>
<p dir="auto">try:<br />
while True:</p>
<pre><code>  for a in range(0,4):
     aout = aout + 1
     bus.writebytes(0x48,0x40 | ((a+1) &amp; 0x03), aout)
     v = bus.readbyte(0x48)
     hashes = v / 4
     spaces = 64 - hashes
     stdscr.addstr(10+a*2, 12, str(v) + ' ')
  stdscr.refresh()
  time.sleep(0.04)

  c = stdscr.getch()

  if c != curses.ERR:
     break
</code></pre>
<p dir="auto">except:<br />
pass</p>
<p dir="auto">curses.nocbreak()<br />
curses.echo()<br />
curses.endwin()</p>
]]></description><link>http://community.onion.io/post/19515</link><guid isPermaLink="true">http://community.onion.io/post/19515</guid><dc:creator><![CDATA[ice long]]></dc:creator><pubDate>Tue, 21 May 2019 21:16:22 GMT</pubDate></item></channel></rss>