Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - FAQ - Zum CC1-Forum - Zum CC-Pro-Forum

Re: RS 232 Reading Kategorie: Programmierung (von Tom - 13.08.2003 23:14)
Als Antwort auf Re: RS 232 Reading von Bernard Mulvihill - 13.08.2003 8:39

Hello Berhard,
replace speed wit one of the following constants:
300  Baud   = 0;
600  Baud    = 1;
1200  Baud   = 2;
2400  Baud   = 3;
4800   Baud  = 4;
9600    Baud = 5;
19200   Baud = 6;
38400   Baud = 7;
57600    Baud= 8;
115200   Baud= 9;

for example

hwcom.setspeed(5);

for 9600 Baud speed.

because there is no variable named speed.

i compiled the rest should be ok .

mfg Tom
//

> Hello Andre
> I tried to compile the programme for ASCII-codes and I got the following error messages.
>
> main (4): unknown identifier "speed"
> main (13): unknown identifier "line"
>
> Could you tell me what the problem is. I am using the original files of hwcom and lcdext. Could this be the problem.
> Regards,
> Bernard.
>
>
>
>
>
> > Hallo Bernard,
> >
> > What should be shown on the LC-Display ?
> > The Byte-Values or a string if there is sent the data
> > as an ASCII-string, by the PH-meter ?
> >
> > For Bytevalues you can use this:
> >
> > thread main
> > {byte i; // charcounter
> >  hwcom.init();
> >  hwcom.setspeed(speed);
> >  lcdext.init();
> >  i=0;
> >  loop
> >  {
> >   wait hwcom.rxd();
> >   lcdext.zahl3(hwcom.get());
> >   i=i+1;
> >   if i>=32 i=0; // for 2x16 LCD, sets charcounter to 0 past 32 Chars
> >   if (i%16)==0 lcdext.line((i/16)+1); //for 2x16 LCD, changes line past 16 Chars
> >  }
> > }

> >
> > For ASCII-codes you can use this:
> >
> > thread main
> > {byte i; // charcounter
> >  hwcom.init();
> >  hwcom.setspeed(speed);
> >  lcdext.init();
> >  i=0;
> >  loop
> >  {
> >   wait hwcom.rxd();
> >   lcdext.put(hwcom.get());
> >   i=i+4;
> >   if i>=32 i=0; // for 2x16 LCD, sets charcounter to 0 past 32 Chars
> >   if (i%16)==0 lcdext.line((i/16)+1); //for 2x16 LCD, changes line past 16 Chars
> >  }
> > }

> >
> > regards, André H.
> >
> >
> > > Hello,
> > > I have conrads c-controller station 2 and I have a question.
> > > Could someone please show me a programme that will read the input of the RS232 serial interface and output it
> > > onto the LCD screen.
> > > I have a pH meter connected to the serial interface and would like to read its output.
> > > Thank you,
> > > Bernard.




    Antwort schreiben


Antworten: