<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Kommentare zu: Programmierung der Getränkeausgabe</title>
	<atom:link href="http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/feed/" rel="self" type="application/rss+xml" />
	<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/</link>
	<description>Eletrotechnik verstehen durch Video Tutorials</description>
	<lastBuildDate>Sun, 13 May 2012 07:00:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Von: jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2382</link>
		<dc:creator>jan</dc:creator>
		<pubDate>Tue, 22 Nov 2011 10:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2382</guid>
		<description>habe den code jetzt mal umgedreht wie bei dir im Video,
klammern dem entsprechend neu sortiert und jetzt klappt es,
ich evrstehe es nicht :(</description>
		<content:encoded><![CDATA[<p>habe den code jetzt mal umgedreht wie bei dir im Video,<br />
klammern dem entsprechend neu sortiert und jetzt klappt es,<br />
ich evrstehe es nicht <img src='http://et-tutorials.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2379</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 22:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2379</guid>
		<description>ach ja hier der neue code,
hier funktioniert die Auswahl bestens,
kann aber keinen Betrag über P1 &quot;einwerfen&quot;
alles was passiert ist das der eine Zeile tiefer rutscht :(
Ich verstehe es einfach nicht,
habe das Programm x-mal umgeschrieben nichts half.
Hoffe du hast eine Lösung parat.
MfG

/*------------------------------------------------------------------------------
HELLO.C

Copyright 1995-2005 Keil Software, Inc.
------------------------------------------------------------------------------*/

#include                 /* special function register declarations   */
                                  /* for the intended 8051 derivative         */

#include                 /* prototype declarations for I/O functions */


#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */
char code reserve [3] _at_ 0x23;         /* space for serial interrupt if     */
#endif                                   /* Stop Exection with Serial Intr.   */
                                         /* is enabled                        */


/*------------------------------------------------
The main C function.  Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {

int Betrag;
char c;
/*------------------------------------------------
Setup the serial port for 1200 baud at 16MHz.
------------------------------------------------*/
#ifndef MONITOR51
    SCON  = 0x50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */
    TMOD &#124;= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */
    TR1   = 1;                  /* TR1:  timer 1 run                          */
    TI    = 1;                  /* TI:   set TI to send first char of UART    */
#endif


c = getchar();
Betrag=0;
c=getchar();
while (1) {

 switch (c)
 {
 case &#039;k&#039;:
 if (Betrag&lt;30)
 {
 printf(&quot;Kaffee kostet 30 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,30-Betrag);

 break;
 }
 printf(&quot;Sie haben Kaffee gewähltn&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=30);
 c=0;
 break;
 case &#039;e&#039;:
 if (Betrag&lt;40)
 {
 printf(&quot;Espresso kostet 40 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Centn&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent einn&quot;,40-Betrag);
 break;
 }
 printf(&quot;Sie haben Espresso gewähltn&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=40);
 c=0;
 break;
 case &#039;c&#039;:
 if (Betrag&lt;50)
 {
 printf(&quot;Cappuchino kostet 50 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,50-Betrag);

 break;
 }
 printf(&quot;Sie haben Cappuchino gewählt\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=50);
 c=0;
 break;
 }c=getchar();
 switch (c)
 {
 case &#039;k&#039;:
 if (Betrag&lt;30)
 {
 printf(&quot;Kaffee kostet 30 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,30-Betrag);

 break;
 }
 printf(&quot;Sie haben Kaffee gewählt\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=30);
 c=0;
 break;
 case &#039;e&#039;:
 if (Betrag&lt;40)
 {
 printf(&quot;Espresso kostet 40 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,40-Betrag);
 break;
 }
 printf(&quot;Sie haben Espresso gewählt\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=40);
 c=0;
 break;
 case &#039;c&#039;:
 if (Betrag&lt;50)
 {
 printf(&quot;Cappuchino kostet 50 Cent\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,50-Betrag);

 break;
 }
 printf(&quot;Sie haben Cappuchino gewählt\n&quot;);
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=50);
 c=0;
 break;
 }
  }
switch (P1)
 {
 case 1:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=1);
 getchar();
 break;
 case 2:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=2);
 getchar();
 break;
 case 4:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=5);
 getchar();
 break;
 case 8:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=10);
 getchar();
 break;
 case 16:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=20);
 getchar();
 break;
 case 32:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=50);
 getchar();
 break;
 case 64:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=100);
 getchar();
 break;
 case 128:
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=200);
 getchar();
 break;

}
}</description>
		<content:encoded><![CDATA[<p>ach ja hier der neue code,<br />
hier funktioniert die Auswahl bestens,<br />
kann aber keinen Betrag über P1 &#8220;einwerfen&#8221;<br />
alles was passiert ist das der eine Zeile tiefer rutscht <img src='http://et-tutorials.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Ich verstehe es einfach nicht,<br />
habe das Programm x-mal umgeschrieben nichts half.<br />
Hoffe du hast eine Lösung parat.<br />
MfG</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
HELLO.C</p>
<p>Copyright 1995-2005 Keil Software, Inc.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/</p>
<p>#include                 /* special function register declarations   */<br />
                                  /* for the intended 8051 derivative         */</p>
<p>#include                 /* prototype declarations for I/O functions */</p>
<p>#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */<br />
char code reserve [3] _at_ 0&#215;23;         /* space for serial interrupt if     */<br />
#endif                                   /* Stop Exection with Serial Intr.   */<br />
                                         /* is enabled                        */</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
The main C function.  Program execution starts<br />
here after stack initialization.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
void main (void) {</p>
<p>int Betrag;<br />
char c;<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Setup the serial port for 1200 baud at 16MHz.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
#ifndef MONITOR51<br />
    SCON  = 0&#215;50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */<br />
    TMOD |= 0&#215;20;               /* TMOD: timer 1, mode 2, 8-bit reload        */<br />
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */<br />
    TR1   = 1;                  /* TR1:  timer 1 run                          */<br />
    TI    = 1;                  /* TI:   set TI to send first char of UART    */<br />
#endif</p>
<p>c = getchar();<br />
Betrag=0;<br />
c=getchar();<br />
while (1) {</p>
<p> switch (c)<br />
 {<br />
 case &#8216;k&#8217;:<br />
 if (Betrag&lt;30)<br />
 {<br />
 printf(&quot;Kaffee kostet 30 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,30-Betrag);</p>
<p> break;<br />
 }<br />
 printf(&quot;Sie haben Kaffee gewähltn&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=30);<br />
 c=0;<br />
 break;<br />
 case &#039;e&#039;:<br />
 if (Betrag&lt;40)<br />
 {<br />
 printf(&quot;Espresso kostet 40 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Centn&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent einn&quot;,40-Betrag);<br />
 break;<br />
 }<br />
 printf(&quot;Sie haben Espresso gewähltn&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=40);<br />
 c=0;<br />
 break;<br />
 case &#039;c&#039;:<br />
 if (Betrag&lt;50)<br />
 {<br />
 printf(&quot;Cappuchino kostet 50 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,50-Betrag);</p>
<p> break;<br />
 }<br />
 printf(&quot;Sie haben Cappuchino gewählt\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=50);<br />
 c=0;<br />
 break;<br />
 }c=getchar();<br />
 switch (c)<br />
 {<br />
 case &#039;k&#039;:<br />
 if (Betrag&lt;30)<br />
 {<br />
 printf(&quot;Kaffee kostet 30 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,30-Betrag);</p>
<p> break;<br />
 }<br />
 printf(&quot;Sie haben Kaffee gewählt\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=30);<br />
 c=0;<br />
 break;<br />
 case &#039;e&#039;:<br />
 if (Betrag&lt;40)<br />
 {<br />
 printf(&quot;Espresso kostet 40 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,40-Betrag);<br />
 break;<br />
 }<br />
 printf(&quot;Sie haben Espresso gewählt\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=40);<br />
 c=0;<br />
 break;<br />
 case &#039;c&#039;:<br />
 if (Betrag&lt;50)<br />
 {<br />
 printf(&quot;Cappuchino kostet 50 Cent\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag);<br />
 printf(&quot;Bitte werfen Sie (mindestens) %d Cent ein\n&quot;,50-Betrag);</p>
<p> break;<br />
 }<br />
 printf(&quot;Sie haben Cappuchino gewählt\n&quot;);<br />
 printf(&quot;Restbetrag: %d Cent\n&quot;, Betrag-=50);<br />
 c=0;<br />
 break;<br />
 }<br />
  }<br />
switch (P1)<br />
 {<br />
 case 1:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=1);<br />
 getchar();<br />
 break;<br />
 case 2:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=2);<br />
 getchar();<br />
 break;<br />
 case 4:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=5);<br />
 getchar();<br />
 break;<br />
 case 8:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=10);<br />
 getchar();<br />
 break;<br />
 case 16:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=20);<br />
 getchar();<br />
 break;<br />
 case 32:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=50);<br />
 getchar();<br />
 break;<br />
 case 64:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=100);<br />
 getchar();<br />
 break;<br />
 case 128:<br />
 printf(&quot;Guthaben: %d cent\n&quot;,Betrag+=200);<br />
 getchar();<br />
 break;</p>
<p>}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2378</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 22:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2378</guid>
		<description>Hallo 
Super das du noch aktiv bist:)
Warum soll ich den Port1 auf null setzen?</description>
		<content:encoded><![CDATA[<p>Hallo<br />
Super das du noch aktiv bist:)<br />
Warum soll ich den Port1 auf null setzen?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Wolfgang Bengfort</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2376</link>
		<dc:creator>Wolfgang Bengfort</dc:creator>
		<pubDate>Mon, 21 Nov 2011 14:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2376</guid>
		<description>Wo wird P1 denn wieder auf 0 gesetzt?</description>
		<content:encoded><![CDATA[<p>Wo wird P1 denn wieder auf 0 gesetzt?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2375</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 11:30:07 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2375</guid>
		<description>So letzte post Tschuldigung nochmal, aber als Hinweis: Es ist so als würde der mein Switch für P1 nie verlassen :/
Er Addiert immer weiter z.B
 Guthaben: 1cent
 Guthaben: 2cent usw.....
wenn ich jetzt auf k drücke sagt er mir
 kGuthaben: 3cent</description>
		<content:encoded><![CDATA[<p>So letzte post Tschuldigung nochmal, aber als Hinweis: Es ist so als würde der mein Switch für P1 nie verlassen :/<br />
Er Addiert immer weiter z.B<br />
 Guthaben: 1cent<br />
 Guthaben: 2cent usw&#8230;..<br />
wenn ich jetzt auf k drücke sagt er mir<br />
 kGuthaben: 3cent</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2374</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 11:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2374</guid>
		<description>Hier nochmald er letzte versuch:
also nur das mit der Kaffe eingabe, hier bekomme ich statt&quot;Kaffe kostet....&quot; nur
kGuthaben: 

switch (c)
  {case &#039;k&#039;:
  if (i&lt;30) 
  {printf(&quot;Kaffe kostet 30cent\n bitte werfen Sie weitere %d ein\n&quot;,Kafee-=i);
  break;
   }
  printf(&quot;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&quot;,i=i-30);	 
  c=0;
  break;   
  	 }</description>
		<content:encoded><![CDATA[<p>Hier nochmald er letzte versuch:<br />
also nur das mit der Kaffe eingabe, hier bekomme ich statt&#8221;Kaffe kostet&#8230;.&#8221; nur<br />
kGuthaben: </p>
<p>switch (c)<br />
  {case &#8216;k&#8217;:<br />
  if (i&lt;30)<br />
  {printf(&quot;Kaffe kostet 30cent\n bitte werfen Sie weitere %d ein\n&quot;,Kafee-=i);<br />
  break;<br />
   }<br />
  printf(&quot;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&quot;,i=i-30);<br />
  c=0;<br />
  break;<br />
  	 }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2372</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 10:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2372</guid>
		<description>Ich will nerven aber die Website hier stellt es ncith richtig dar -.-</description>
		<content:encoded><![CDATA[<p>Ich will nerven aber die Website hier stellt es ncith richtig dar -.-</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2371</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 10:36:50 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2371</guid>
		<description>Also nochmal irgendwie hatd er alles falsch rein kopiert:

/*------------------------------------------------------------------------------
HELLO.C

Copyright 1995-2005 Keil Software, Inc.
------------------------------------------------------------------------------*/

#include                 /* special function register declarations   */
                                  /* for the intended 8051 derivative         */

#include                 /* prototype declarations for I/O functions */


#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */
char code reserve [3] _at_ 0x23;         /* space for serial interrupt if     */
#endif                                   /* Stop Exection with Serial Intr.   */
                                         /* is enabled                        */


/*------------------------------------------------
The main C function.  Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {

int i,Kafee;
char auswahl;
/*------------------------------------------------
Setup the serial port for 1200 baud at 16MHz.
------------------------------------------------*/
#ifndef MONITOR51
    SCON  = 0x50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */
    TMOD &#124;= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */
    TR1   = 1;                  /* TR1:  timer 1 run                          */
    TI    = 1;                  /* TI:   set TI to send first char of UART    */
#endif


i=0;
Kafee=30; 
  while (1) {
  switch (auswahl)
  {case &#039;k&#039;:
  if (i=30)
  {	printf(&quot;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&quot;,i=i-30);
  break;
  }
 
switch (P1)
{case 1:
printf(&quot;Guthaben: %d cent\n&quot;,++i);
getchar();
break;
case 2:
i=i+2;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 4:
i=i+5;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 8:
i=i+10;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 16:
i=i+20;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 32:
i=i+50;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 64:
i=i+100;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 128:
i=i+200;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 0:
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 3:
printf(&quot;Ihr Restguthaben wird Ihnen Ausgegeben: %d cent\n&quot;,i);
i=i-i;
getchar();
break;
default:
printf(&quot;Ihr Geld wird Ausgeworfen&quot;);
break;

}
} 
  }
}</description>
		<content:encoded><![CDATA[<p>Also nochmal irgendwie hatd er alles falsch rein kopiert:</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
HELLO.C</p>
<p>Copyright 1995-2005 Keil Software, Inc.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/</p>
<p>#include                 /* special function register declarations   */<br />
                                  /* for the intended 8051 derivative         */</p>
<p>#include                 /* prototype declarations for I/O functions */</p>
<p>#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */<br />
char code reserve [3] _at_ 0&#215;23;         /* space for serial interrupt if     */<br />
#endif                                   /* Stop Exection with Serial Intr.   */<br />
                                         /* is enabled                        */</p>
<p>/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
The main C function.  Program execution starts<br />
here after stack initialization.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
void main (void) {</p>
<p>int i,Kafee;<br />
char auswahl;<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Setup the serial port for 1200 baud at 16MHz.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
#ifndef MONITOR51<br />
    SCON  = 0&#215;50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */<br />
    TMOD |= 0&#215;20;               /* TMOD: timer 1, mode 2, 8-bit reload        */<br />
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */<br />
    TR1   = 1;                  /* TR1:  timer 1 run                          */<br />
    TI    = 1;                  /* TI:   set TI to send first char of UART    */<br />
#endif</p>
<p>i=0;<br />
Kafee=30;<br />
  while (1) {<br />
  switch (auswahl)<br />
  {case &#8216;k&#8217;:<br />
  if (i=30)<br />
  {	printf(&#8220;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&#8221;,i=i-30);<br />
  break;<br />
  }</p>
<p>switch (P1)<br />
{case 1:<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,++i);<br />
getchar();<br />
break;<br />
case 2:<br />
i=i+2;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 4:<br />
i=i+5;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 8:<br />
i=i+10;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 16:<br />
i=i+20;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 32:<br />
i=i+50;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 64:<br />
i=i+100;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 128:<br />
i=i+200;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 0:<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 3:<br />
printf(&#8220;Ihr Restguthaben wird Ihnen Ausgegeben: %d cent\n&#8221;,i);<br />
i=i-i;<br />
getchar();<br />
break;<br />
default:<br />
printf(&#8220;Ihr Geld wird Ausgeworfen&#8221;);<br />
break;</p>
<p>}<br />
}<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-2370</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Mon, 21 Nov 2011 10:34:40 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-2370</guid>
		<description>Hi warum funktioniert das nicht? :(
Kann nicht mal mehr über den P1 Geld einwerfen

void main (void) {

int i,Kafee;
char auswahl;
/*------------------------------------------------
Setup the serial port for 1200 baud at 16MHz.
------------------------------------------------*/
#ifndef MONITOR51
    SCON  = 0x50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */
    TMOD &#124;= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */
    TR1   = 1;                  /* TR1:  timer 1 run                          */
    TI    = 1;                  /* TI:   set TI to send first char of UART    */
#endif


i=0;
Kafee=30; 
  while (1) {
  switch (auswahl)
  {case &#039;k&#039;:
  if (i=30)
  {	printf(&quot;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&quot;,i=i-30);
  break;
  }
 
switch (P1)
{case 1:
printf(&quot;Guthaben: %d cent\n&quot;,++i);
getchar();
break;
case 2:
i=i+2;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 4:
i=i+5;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 8:
i=i+10;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 16:
i=i+20;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 32:
i=i+50;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 64:
i=i+100;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 128:
i=i+200;
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 0:
printf(&quot;Guthaben: %d cent\n&quot;,i);
getchar();
break;
case 3:
printf(&quot;Ihr Restguthaben wird Ihnen Ausgegeben: %d cent\n&quot;,i);
i=i-i;
getchar();
break;
default:
printf(&quot;Ihr Geld wird Ausgeworfen&quot;);
break;

}
} 
  }
}</description>
		<content:encoded><![CDATA[<p>Hi warum funktioniert das nicht? <img src='http://et-tutorials.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Kann nicht mal mehr über den P1 Geld einwerfen</p>
<p>void main (void) {</p>
<p>int i,Kafee;<br />
char auswahl;<br />
/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Setup the serial port for 1200 baud at 16MHz.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*/<br />
#ifndef MONITOR51<br />
    SCON  = 0&#215;50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */<br />
    TMOD |= 0&#215;20;               /* TMOD: timer 1, mode 2, 8-bit reload        */<br />
    TH1   = 221;                /* TH1:  reload value for 1200 baud @ 16MHz   */<br />
    TR1   = 1;                  /* TR1:  timer 1 run                          */<br />
    TI    = 1;                  /* TI:   set TI to send first char of UART    */<br />
#endif</p>
<p>i=0;<br />
Kafee=30;<br />
  while (1) {<br />
  switch (auswahl)<br />
  {case &#8216;k&#8217;:<br />
  if (i=30)<br />
  {	printf(&#8220;Warten Sie Ihr Kaffe wird eingeschänkt \nIhr Restbetrag beträgt: %d\n&#8221;,i=i-30);<br />
  break;<br />
  }</p>
<p>switch (P1)<br />
{case 1:<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,++i);<br />
getchar();<br />
break;<br />
case 2:<br />
i=i+2;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 4:<br />
i=i+5;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 8:<br />
i=i+10;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 16:<br />
i=i+20;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 32:<br />
i=i+50;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 64:<br />
i=i+100;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 128:<br />
i=i+200;<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 0:<br />
printf(&#8220;Guthaben: %d cent\n&#8221;,i);<br />
getchar();<br />
break;<br />
case 3:<br />
printf(&#8220;Ihr Restguthaben wird Ihnen Ausgegeben: %d cent\n&#8221;,i);<br />
i=i-i;<br />
getchar();<br />
break;<br />
default:<br />
printf(&#8220;Ihr Geld wird Ausgeworfen&#8221;);<br />
break;</p>
<p>}<br />
}<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Wolfgang Bengfort</title>
		<link>http://et-tutorials.de/1706/programmierung-der-getrankeausgabe/comment-page-1/#comment-381</link>
		<dc:creator>Wolfgang Bengfort</dc:creator>
		<pubDate>Wed, 07 Apr 2010 12:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://et-tutorials.de/?p=1706#comment-381</guid>
		<description>Hallo Christian,

&quot;1. Warum muss ich jetzt bei der case Anweisung mit Hochkomma arbeiten (case ‘k’) in den anderen Lektionen haben wir nur z.B. (case 6) geschrieben. Hat das etwas mit dem Variablen Typ char zu tun?

2. Warum wird bei mir der Programmcode nach der Whileschleife (while (Preis-Betrag&gt;0) )nicht bearbeitet??? &quot;

1.) Ja, das hat mit dem Variablentyp char zu tun.
2.) Es sieht so aus, als wenn Du die switch  - Klammer nicht schließen würdest. Nach dem break von case &#039;c&#039; müßte eine } - Klammer stehen, die dann weiter unten entfernt werden müsste.

Tipp: Kommentieren Deine schließenden Klammern, z.B.

} // End while
oder
}// End main

Dann behälst D leichter den Überblick.

Viele Grüße

Wolfgang</description>
		<content:encoded><![CDATA[<p>Hallo Christian,</p>
<p>&#8220;1. Warum muss ich jetzt bei der case Anweisung mit Hochkomma arbeiten (case ‘k’) in den anderen Lektionen haben wir nur z.B. (case 6) geschrieben. Hat das etwas mit dem Variablen Typ char zu tun?</p>
<p>2. Warum wird bei mir der Programmcode nach der Whileschleife (while (Preis-Betrag>0) )nicht bearbeitet??? &#8221;</p>
<p>1.) Ja, das hat mit dem Variablentyp char zu tun.<br />
2.) Es sieht so aus, als wenn Du die switch  &#8211; Klammer nicht schließen würdest. Nach dem break von case &#8216;c&#8217; müßte eine } &#8211; Klammer stehen, die dann weiter unten entfernt werden müsste.</p>
<p>Tipp: Kommentieren Deine schließenden Klammern, z.B.</p>
<p>} // End while<br />
oder<br />
}// End main</p>
<p>Dann behälst D leichter den Überblick.</p>
<p>Viele Grüße</p>
<p>Wolfgang</p>
]]></content:encoded>
	</item>
</channel>
</rss>

