<?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[G15 LCD programm [Verbesserungen?!]]]></title><description><![CDATA[<p>Ich habe mir für meine Tastatur ein Progrämmchen geschreiben, welches mir einen Pixel auf meinem LCD anzeigt und diesen von oben links angefangen nach unten rechts wandern lässt nun frage ich hier ob ich dies auch einfacher schreiben könnte?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;stdafx.h&quot;

using namespace std;

template&lt;typename T&gt;
  string toStr(T var)
{
  std::ostringstream Str;
  Str &lt;&lt; var;
  return Str.str();
}
DISPLAYDATA clearLCD(int black = 128,LCDDEVICE Device = NULL)
{
    int x,y;
    DISPLAYDATA pointer;
    for(y = 0;y&lt;(LGLCD_BMP_HEIGHT / 8)+1;y++)
    {
        for(x = 0;x&lt;LGLCD_BMP_WIDTH;x++)
        {
            pointer.data[y][x] = black;
            cout &lt;&lt; pointer.data[y][x];
        }
    }

    return pointer;
}

int main()
{
    DWORD KeybdVer = 0;
    LCDDEVICE Device = LgOpenLcdDevice(0, FALSE, &amp;KeybdVer);
    DISPLAYDATA DisplayImage;
    int pointX = 0,pointY = 0,Ycolum = 0,foo = 1,dump = 0,schlaufe = 0, repeat = 1;

    double fm = 2;
    while (repeat == 1)
    {
        cout &lt;&lt; &quot;Geben sie ein wie oft der schleife durchwandert werden soll&quot; &lt;&lt; endl;
        cin &gt;&gt; schlaufe;
        for(int win = 0;win&lt;schlaufe;win++)
        {

            foo = win%8;
            if(win%40 == 3)
            {
                dump = 0;
            }
            if(foo==0)
            {
                pointY++;
                pointX++;
                if(pointY&gt;=5)
                {
                    pointY = 0;
                }
            }
            else
            {
                pointX++;
            }
            if(pointX == LGLCD_BMP_WIDTH)
            {
                pointX = 0;
            }
            else{}
            DisplayImage = clearLCD(0,Device);
            dump = pow(fm,Ycolum);
            if(Ycolum == 7)
            {
                Ycolum = 0;
            }
            else
            {
                Ycolum++;
            }
            cout &lt;&lt; Ycolum &lt;&lt; &quot; || Ycolum&quot; &lt;&lt; endl;
            cout &lt;&lt; foo &lt;&lt; &quot; || foo&quot;&lt;&lt; endl;
            cout &lt;&lt; pointY &lt;&lt; &quot; || pointY&quot;&lt;&lt; endl;
            cout &lt;&lt; pointX &lt;&lt; &quot; || pointX&quot;&lt;&lt; endl;
            cout &lt;&lt; dump &lt;&lt; &quot; || dump&quot;&lt;&lt; endl;
            DisplayImage.data[pointY][pointX] = dump;
            LgSetDisplayData (Device,&amp;DisplayImage);
        }
        cout &lt;&lt; &quot;Wiederholen? 1 fuer ja 0 fuer nein&quot; &lt;&lt;endl;
        cin &gt;&gt; repeat;
    }
    LgFreeLcdDevice(Device);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/280109/g15-lcd-programm-verbesserungen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 06:59:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/280109.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jan 2011 19:49:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to G15 LCD programm [Verbesserungen?!] on Sun, 09 Jan 2011 19:49:46 GMT]]></title><description><![CDATA[<p>Ich habe mir für meine Tastatur ein Progrämmchen geschreiben, welches mir einen Pixel auf meinem LCD anzeigt und diesen von oben links angefangen nach unten rechts wandern lässt nun frage ich hier ob ich dies auch einfacher schreiben könnte?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;stdafx.h&quot;

using namespace std;

template&lt;typename T&gt;
  string toStr(T var)
{
  std::ostringstream Str;
  Str &lt;&lt; var;
  return Str.str();
}
DISPLAYDATA clearLCD(int black = 128,LCDDEVICE Device = NULL)
{
    int x,y;
    DISPLAYDATA pointer;
    for(y = 0;y&lt;(LGLCD_BMP_HEIGHT / 8)+1;y++)
    {
        for(x = 0;x&lt;LGLCD_BMP_WIDTH;x++)
        {
            pointer.data[y][x] = black;
            cout &lt;&lt; pointer.data[y][x];
        }
    }

    return pointer;
}

int main()
{
    DWORD KeybdVer = 0;
    LCDDEVICE Device = LgOpenLcdDevice(0, FALSE, &amp;KeybdVer);
    DISPLAYDATA DisplayImage;
    int pointX = 0,pointY = 0,Ycolum = 0,foo = 1,dump = 0,schlaufe = 0, repeat = 1;

    double fm = 2;
    while (repeat == 1)
    {
        cout &lt;&lt; &quot;Geben sie ein wie oft der schleife durchwandert werden soll&quot; &lt;&lt; endl;
        cin &gt;&gt; schlaufe;
        for(int win = 0;win&lt;schlaufe;win++)
        {

            foo = win%8;
            if(win%40 == 3)
            {
                dump = 0;
            }
            if(foo==0)
            {
                pointY++;
                pointX++;
                if(pointY&gt;=5)
                {
                    pointY = 0;
                }
            }
            else
            {
                pointX++;
            }
            if(pointX == LGLCD_BMP_WIDTH)
            {
                pointX = 0;
            }
            else{}
            DisplayImage = clearLCD(0,Device);
            dump = pow(fm,Ycolum);
            if(Ycolum == 7)
            {
                Ycolum = 0;
            }
            else
            {
                Ycolum++;
            }
            cout &lt;&lt; Ycolum &lt;&lt; &quot; || Ycolum&quot; &lt;&lt; endl;
            cout &lt;&lt; foo &lt;&lt; &quot; || foo&quot;&lt;&lt; endl;
            cout &lt;&lt; pointY &lt;&lt; &quot; || pointY&quot;&lt;&lt; endl;
            cout &lt;&lt; pointX &lt;&lt; &quot; || pointX&quot;&lt;&lt; endl;
            cout &lt;&lt; dump &lt;&lt; &quot; || dump&quot;&lt;&lt; endl;
            DisplayImage.data[pointY][pointX] = dump;
            LgSetDisplayData (Device,&amp;DisplayImage);
        }
        cout &lt;&lt; &quot;Wiederholen? 1 fuer ja 0 fuer nein&quot; &lt;&lt;endl;
        cin &gt;&gt; repeat;
    }
    LgFreeLcdDevice(Device);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2004655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2004655</guid><dc:creator><![CDATA[Sheepstyle]]></dc:creator><pubDate>Sun, 09 Jan 2011 19:49:46 GMT</pubDate></item></channel></rss>