This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Wednesday, January 9, 2008

[oopic] Re: Interpreting serial data.

Hello,

Thank you so so so so so much. It's working. As richard told i
declared all my objects outside the main function,and also as Dan
said i set the baud rate. I forgot to set the baud rate. I changed
baud settings on my bluetooth adapter to 9600,and set the baud rate
in oopic program to 9600,which solved my problem.

Thanks a lot .

--- In oopic@yahoogroups.com, "dan michaels" <oric_dan@...> wrote:
>
> --- In oopic@yahoogroups.com, "aravind_2917" <aravind_2917@> wrote:
> >
>
>
> Besides what Richard mentioned, be sure your baudrates are the same
> on both ends. You didn't specifically set it here.
>
> Also, I would not run untested programs on 2 ends at the same time.
I
> would test the oopic program, in isolation, using a terminal
emulator
> running on the PC, such as Hyperterminal, etc. Once the oopic
program
> is working ok, then try some fancier program on the PC [mobile?]
end.
> Otherwise, there is no way to tell which is working properly.
>
> Also, I'd use something other than a 5 as the test value, since
it's
> not a displayable ASCII character.
>
>
>
> > Thank you very much for replying...
> >
> > I tried writing a program similar to whats there in tht link..
> > here is what i tried (and failed)...
> >
> > Delay=2000;
> > Void main(void){
> > oByte b1=new oByte; //holds incoming data
> > oByte b2=new oByte; //holds pre-defined data
> > b2.Value=5; //assgined a value 5
> > oSerialPort sp=new oSerialPort;
> > oLed l1=new oLed; //leds for testing
> > oLed l2=new oLed;
> > l1.IOLine=5;
> > l2.IOLine=6;
> > sp.Operate=1;
> > Do{
> > If(sp.received==cvTrue){
> > l1.TurnOn; //just to check whether it has entered this
block
> > //that means data is received..this glows
> > b1.Value=sp.Value;
> > If(b1.Value==b2.Value){
> > l2.TurnOn; //if comparision was successful..doesnt
glow
> > }
> > }//end of outer IF
> > }//end of DO
> > }//end of main
> >
> > Data is being received by oopic,but the comparision fails...
> > Iam trying to send data from java J2ME program running in a
> > mobile...Java J2ME has a method to write data to output stream..
> >
> > Documentation says this about the method which am using to send
> data:
> > write(int b) :Writes the specified byte to the output stream. The
> > general contract for write is that one byte is written to the
> output
> > stream. The byte to be written is the eight low-order bits of the
> > argument b. The 24 high-order bits of b are ignored.
> > i used write(5); in my sending code..
> >
> > Next i tried comparing the received value b1.Value with all 0-255
> > values..by incrementing and comparing,using another byte value
> > starting from zero...None of the values from 0-255 matches
b1.Value!
> >
> > pls help me..
> >
> > thank you
> >
> > --- In oopic@yahoogroups.com, <dennis.clark@> wrote:
> > >
> > > Thanks Dan, that's a nice link.
> > >
> > > DLC
> > >
> > > ooPIC Tech Support
> > >
> > > -----Original Message-----
> > >
> > > From: "dan michaels" <oric_dan@>
> > > Subj: [oopic] Re: Interpreting serial data.
> > > Date: Tue Jan 8, 2008 8:25 am
> > > Size: 1K
> > > To: oopic@yahoogroups.com
> > >
> > > --- In oopic@yahoogroups.com, "aravind_2917" <aravind_2917@>
> wrote:
> > > >
> > > > hello,
> > > >
> > > > Iam trying to communicate with oopic from my mobile over the
> > serial
> > > > port using bluetooth dongle...everything is working fine...i
> can
> > > make out that data is being transmitted to the oopic and oopic
is
> > > receiving the data...
> > > >
> > > > Iam sending single character from the mobile...like 's' for
> > > example...i can even send a single byte from the mobile..
> > > >
> > > > Now,how do i interpret the data received by OOPIC...am using
> > > > oSerialPort object...
> > > >
> > > > oSerailPort sp=new oSerialPort;
> > > > sp.Operate=1;
> > > >
> > > > i want to compare the values received ,with predefined values
> and
> > > carry out other tasks accordingly...like ,start a motor if 's'
is
> > > > received..stop the motor if 't' is received...How do i do
> > > that?..what are the conversions and comparisions involved?
> > > >
> > >
> > >
> > > I have example code that does similar to what you describe on
the
> > > bottom of this page ...
> > >
> > > http://www.oricomtech.com/projects/rolandp.htm
> > >
> > >
> > > - dan michaels
> > > www.oricomtech.com
> > > --- OOBOT40 Boards ---
> > > =========================
> > >
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> >
>



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: