<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=12&amp;t=17726&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-02-24T14:47:31+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=12&amp;t=17726&amp;mode</id>
<entry>
<author><name><![CDATA[slawek3000]]></name></author>
<updated>2017-02-24T14:47:31+01:00</updated>
<published>2017-02-24T14:47:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=17726&amp;p=183473#p183473</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=17726&amp;p=183473#p183473"/>
<title type="html"><![CDATA[ADS 1015]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=17726&amp;p=183473#p183473"><![CDATA[
[/syntax]Witam,<br />czy może ktoś już pisał oprogramowanie do ADS 1015 z pod bascoma ? <img src="https://forum.atnel.pl/images/smilies/icon_e_biggrin.gif" alt=":D" title="Bardzo szczęśliwy" /><br />znalazłem coś w internecie ,ale pokazuje mi napięcie z jednego kanału jak to oprogramować ,żeby były 4 kanały <br />[syntax=basic4gl]$regfile = &quot;m644pdef.dat&quot;                                   ' specify the used micro<br />$crystal = 16000000<br />$baud = 9600                                                ' use baud rate<br />$hwstack = 32                                               ' default use 32 for the hardware stack<br />$swstack = 10                                               ' default use 10 for the SW stack<br />$framesize = 40<br /><br /><br />$lib &quot;glcdKS108.lbx&quot;<br />'$lib &quot;mcsbyte.lbx&quot;                                          ' for smaller code<br />$lib &quot;ds1307clock.lib&quot;<br />$include &quot;Card_init.bas&quot;<br />$lib &quot;Datetime.lbx&quot;<br />'First we define that we use a graphic LCD<br />Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portd , Ce = 6 , Ce2 = 7 , Cd = 4 , Rd = 3 , Reset = 2 , Enable = 5<br /><br /><br />Dim High_low As Word<br />Dim Hibyte As Byte At High_low Overlay<br />Dim Lobyte As Byte At High_low + 1 Overlay<br />Dim W_addr As Byte<br />Dim R_addr As Byte<br />Dim Read1aint As Single<br />Dim Pga As Integer<br />Dim Napiecie As Word<br />Dim Napiecies As String * 10<br />Dim Przelicz As Single<br />'addr_pin grounded<br /><br />'address for  write to ads1015<br />W_addr = &amp;B10010000<br /><br />'address for  read from ads1015<br />R_addr = &amp;B10010001<br /><br /><br />' Configure pins to to use for the I2C bus<br /><br /><br />Config Sda = Portc.1<br />Config Scl = Portc.0<br />Config I2cdelay = 10<br />I2cinit<br /><br />'Const Config_high = &amp;B11000000                             '6144<br />'Const Config_high = &amp;B11000010                              '4096<br />Const Config_high = &amp;B11000100                              '2048<br />'Const Config_high = &amp;B11000110                              '1024<br /><br />Const Config_low = &amp;B00000000<br /><br /><br />'I2cstart<br />'I2cwbyte W_addr<br />'I2cwbyte &amp;B00000001<br />'I2cwbyte Config_high<br />'I2cwbyte Config_low<br />'I2cstop<br /><br />'Waitms 25<br />Pga = 2<br /><br />'******************************************<br />Cls<br />Do<br /><br />   Gosub Read_ad<br />   Gosub Wyswietl<br /><br />Setfont Font8x8 : Lcdat 3 , 1 , High_low<br /><br /><br />Setfont Font8x8 : Lcdat 1 , 1 , Hex(hibyte) ; &quot; &quot; ; Hex(lobyte)<br /> Setfont Font8x8 : Lcdat 5 , 1 , Lobyte ; &quot; &quot; ; Hibyte<br /><br /><br />Loop<br />End<br /><br />Read_ad:<br />I2cstart<br />I2cwbyte W_addr<br />I2cwbyte &amp;B00000001<br />I2cwbyte Config_high<br />I2cwbyte Config_low<br />I2cstop<br /><br /><br />I2cstart<br />   I2cwbyte W_addr<br />   I2cwbyte 0<br />   I2cstop<br />   I2cstart                                                 '****** STOP lub powtarzane START<br />   I2cwbyte R_addr<br />   I2crbyte Lobyte , Ack                                    ' *****<br />   I2crbyte Hibyte , Nack                                   '*****<br />   I2cstop<br /><br />Read1aint = Lobyte * 256                                    'Przekształcenie<br />Read1aint = Read1aint + Hibyte                              'Dla ADS1100 wpisujemy zamiast 2.048 wartość napięcia zasilania, im dokladniej tym lepiej, od tego zalezy dokladność pomiarów<br />Read1aint = Read1aint * 5.0<br />Read1aint = Read1aint / 32768<br />Read1aint = Read1aint / Pga<br />Read1aint = Read1aint * 1<br />Napiecies = Fusing(read1aint , &quot;&amp;.&amp;&amp;&amp;&quot;)<br />Return<br />Wyswietl:<br />    Setfont Font8x8 : Lcdat 7 , 1 , Read1aint<br />    Setfont Font8x8 : Lcdat 8 , 1 , Napiecies<br /><br />Return<br />$include &quot;my6_8.font&quot;<br />$include &quot;my12_16.font&quot;<br />$include &quot;font8x8.font&quot;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=988">slawek3000</a> — 24 lut 2017, o 14:47</p><hr />
]]></content>
</entry>
</feed>