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.

Monday, January 7, 2008

[oopic] Interpreting serial data.

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?



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/

[oopic] Problem with events.

Iam trying to execute a piece of code whever serial data is recieved
over the Serial port...I have oopic-R c.1.1+ firmware...till now i
have not been successful with any event driven program..can u please
tell me whats wrong with the following code...

Delay=2000;
oEvent ev=New oEvent;
oSerialPort sp=New oSerialPort;
Void main(Void){
Delay=2000;

oLED l=New oLED;
oWire w=New oWire;
oWire w2=New oWire;


ev.Operate=0 // initially to make sure ev.operate=0
l.IOLine=5;
sp.Operate=1;

w.Input.Link(sp.Received);
w.Output.Link(l.Operate);//trying to switch on an in built led
w.Operate=cvTrue;

w2.Input.Link(sp.Received);
w2.Output1.Link(ev.Operate);
w2.Operate=cvTrue;

}

Void ev_Code(){ //this code is not being executed
oLED l3=New oLED;
l3.IOLine=7;
l3.TurnOn;
oInt i=New oInt;
While(sp.Received!=0){ //trying to read from sp buffer
i=sp.Value; //till sp.recieved is set to 0.
}
}

someone give me a code with which i can test whether events are
working on my board...OOPIC-R c.1.1+

Thank you


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/

[oopic] Program Resetting Upon Completion of Stepper Motor Script

Hello,

I am working with oopic-r c1.x+ and compiler 6.1.1. The h-bridge
we're using is the L298 and is wired correctly as per the data sheet
with ground and +5v for the oopic and the L298 both coming from the
same battery source. The following snippet of code is
looping--resetting the oopic upon execution of the last line. The
behavior happens during similar scripts as well.

code:

oStepper stepper = New oStepper;

Void Main(Void) {
ooPIC.Delay = 500;
stepper.IOPack = 3;
stepper.Phasing = 1;
stepper.Mode = 0;
stepper.Rate = 124;
stepper.Value = 800;

stepper.Operate = 1
}

In this sample case, the stepper travels 800 steps and restarts and
travels another 800 steps and restarts, etc.

Why is it doing this and how can I stop it from resetting? Thanks in
advance.


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/

Saturday, January 5, 2008

Re: [oopic] help with event driven bumper switches

w1.Operate = cvTrue
w2.Operate = cvTrue

DLC

dldlhfd@aol.com wrote:
> I hope you can help.
> I am using C.1.1+ board and version 6.1.1 compiler
> I have pared the program down to just include a simple event. the whole
> project is a robot with two bumper switches, one front one back.
> 1. The robot goes forward as it should no problem
> 2. if I call any of the routines from the main program it executes as they
> should.
> 3. I have two bumper switches set up
> 4. both switches supply 5 volts to their respective IO line normally
> 5. when the switch is bumped the switch voltage supplied to the IO line goes
> to 0 volts
> 6. The program ignores the bumper switches.
> 7. I physically read the voltages and they are changing when the switched is
> pressed.
> 8. I tried putting a do loop around the last four lines of the main sub but
> it ignored the switches then also
>
> Here is what I think should be happening with the values:
>
> switch1.IOLine = 13 'assign bumper sw 1 to line 13
> normal bumped
> w1.Input.Link(switch1.Position) 'read bump sw1 assign to wire b1
> 5 0
> w1.Output.Link(bumprd1.Operate) 'assign to on/off of event
> 5 0
> w1.InvertOut = cvTrue '5v is normal 0v is bumped
> 0 5
> I think he last one should give a transition from 0 to 5 and the 5(true)
> should when copied to the operate property of the event cause the program to go
> to the event_code.
> Can you give me a clue as to why this won't execute the event code? I have
> also tried reading I/O lines instead of a switch object.
> Kind of a side question but can I run the OOPIC connected to the PC and have
> it read the values or run the program as if it were connected to a virtual
> robot and switches. As it is if it does not work the dumb thing just sits
> there. No indication if it is working or not.
> Dim led7 As New oLED 'red
> Dim led6 As New oLED 'yellow
> Dim led5 As New oLED 'green
> Dim bumprd1 As New oEvent 'if bumped forward
> Dim bumprd2 As New oEvent 'if bumped backward
> Dim w1 As New oWire
> Dim w2 As New oWire
> Dim switch1 As New oSwitch
> Dim switch2 As New oSwitch
> Sub Main()
> led7.IOLine=7
> led7.Operate=cvOn
> led6.IOLine=6
> led6.Operate=cvOn
> led5.Operate=cvOn
> led5.IOLine=5
> 'physically the switch has normally 5 V
> 'physically when it is bumped the value is 0 volts
> switch1.IOLine = 13 'assigh bumper sw 1 to line 13
> w1.Input.Link(switch1.Position) 'read bump sw1 assign to wire b1
> w1.Output.Link(bumprd1.Operate) 'assign to on/off of event
> w1.InvertOut = cvTrue '5v is normal 0v is bumped
> 'switch two
> 'physically the switch has normally 5V
> 'physically when it is bumped the value is 0 volts
> switch2.IOLine = 14 'assign bumper sw 2 to line 14
> w2.Input.Link(switch1.Position) 'read bump sw2 assign to wire 2
> w2.Output.Link(bumprd2.Operate) 'output of bumper 2
> w2.InvertOut = cvTrue '5v is normal 0v is bumped
> 'do
> led5.TurnOnBright 'bright green light says I am here
> ooPIC.Delay=1000 'SLOW IT DOWN SO I CAN SEE
> led5.TurnOff 'one loop of main
> ooPIC.Delay=1000
> 'loop
> End Sub
> Sub bumprd1_Code() 'event code if bumper 1 = 0v
> led6.TurnOnBright 'yellow
> ooPIC.Delay = 5000 'wait 5 seconds to see
> led6.TurnOff 'turn yellow back off
> End Sub
> Sub bumprd2_Code() 'evnet code if bumper 2 = 0v
> led7.TurnOnBright 'yellow
> ooPIC.Delay = 5000
> led7.TurnOff 'turn the yellow off
> End Sub
>
>
>
>
> **************Start the year off right. Easy ways to stay in shape.
> http://body.aol.com/fitness/winter-exercise?NCID=aolcmp00300000002489
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------


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/

[oopic] help with event driven bumper switches

I hope you can help.
I am using C.1.1+ board and version 6.1.1 compiler
I have pared the program down to just include a simple event. the whole
project is a robot with two bumper switches, one front one back.
1. The robot goes forward as it should no problem
2. if I call any of the routines from the main program it executes as they
should.
3. I have two bumper switches set up
4. both switches supply 5 volts to their respective IO line normally
5. when the switch is bumped the switch voltage supplied to the IO line goes
to 0 volts
6. The program ignores the bumper switches.
7. I physically read the voltages and they are changing when the switched is
pressed.
8. I tried putting a do loop around the last four lines of the main sub but
it ignored the switches then also

Here is what I think should be happening with the values:

switch1.IOLine = 13 'assign bumper sw 1 to line 13
normal bumped
w1.Input.Link(switch1.Position) 'read bump sw1 assign to wire b1
5 0
w1.Output.Link(bumprd1.Operate) 'assign to on/off of event
5 0
w1.InvertOut = cvTrue '5v is normal 0v is bumped
0 5
I think he last one should give a transition from 0 to 5 and the 5(true)
should when copied to the operate property of the event cause the program to go
to the event_code.
Can you give me a clue as to why this won't execute the event code? I have
also tried reading I/O lines instead of a switch object.
Kind of a side question but can I run the OOPIC connected to the PC and have
it read the values or run the program as if it were connected to a virtual
robot and switches. As it is if it does not work the dumb thing just sits
there. No indication if it is working or not.
Dim led7 As New oLED 'red
Dim led6 As New oLED 'yellow
Dim led5 As New oLED 'green
Dim bumprd1 As New oEvent 'if bumped forward
Dim bumprd2 As New oEvent 'if bumped backward
Dim w1 As New oWire
Dim w2 As New oWire
Dim switch1 As New oSwitch
Dim switch2 As New oSwitch
Sub Main()
led7.IOLine=7
led7.Operate=cvOn
led6.IOLine=6
led6.Operate=cvOn
led5.Operate=cvOn
led5.IOLine=5
'physically the switch has normally 5 V
'physically when it is bumped the value is 0 volts
switch1.IOLine = 13 'assigh bumper sw 1 to line 13
w1.Input.Link(switch1.Position) 'read bump sw1 assign to wire b1
w1.Output.Link(bumprd1.Operate) 'assign to on/off of event
w1.InvertOut = cvTrue '5v is normal 0v is bumped
'switch two
'physically the switch has normally 5V
'physically when it is bumped the value is 0 volts
switch2.IOLine = 14 'assign bumper sw 2 to line 14
w2.Input.Link(switch1.Position) 'read bump sw2 assign to wire 2
w2.Output.Link(bumprd2.Operate) 'output of bumper 2
w2.InvertOut = cvTrue '5v is normal 0v is bumped
'do
led5.TurnOnBright 'bright green light says I am here
ooPIC.Delay=1000 'SLOW IT DOWN SO I CAN SEE
led5.TurnOff 'one loop of main
ooPIC.Delay=1000
'loop
End Sub
Sub bumprd1_Code() 'event code if bumper 1 = 0v
led6.TurnOnBright 'yellow
ooPIC.Delay = 5000 'wait 5 seconds to see
led6.TurnOff 'turn yellow back off
End Sub
Sub bumprd2_Code() 'evnet code if bumper 2 = 0v
led7.TurnOnBright 'yellow
ooPIC.Delay = 5000
led7.TurnOff 'turn the yellow off
End Sub


**************Start the year off right. Easy ways to stay in shape.

http://body.aol.com/fitness/winter-exercise?NCID=aolcmp00300000002489


[Non-text portions of this message have been removed]


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/

[oopic] Re: need technical support, anyone can help?

thank you very much for your helps i will try it all..
best regards
cihan
--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...> wrote:
>
> Remove the Big chip (ooPIC) from the board and try to download. If
that
> works then the CPU is accessing the EEPROM when the computer is trying
> to program it. This can be because the reset line is not pulling low,
> which means that your connection to the computer is bad, the CPU is
> damaged or the cable is bad. If it still doesn't work with the CPU
> pulled out then either the EEPROM is damaged or has a bent pin or
again,
> the cable is bad. Check to see if the /reset line pulls low, to do
this
> you'll need a DVM and to use the troubleshooting screen (the one
used to
> choose a cable) to set various lines to see if they go low/high. If
all
> the pins toggle as they should and the programmer works when the big
> chip is removed then the CPU is bad. If all of the lines toggle and
the
> EEPROM DOES program when the big chip is removed then the EEPROM is
> either bad or has a bent pin.
>
> DLC
>
> chngedik wrote:
> > no, it was giving around 8~9 volts
> > it was nothing about connections.
> > --- In oopic@yahoogroups.com, <dennis.clark@> wrote:
> >
> >> Battery? An oft overlooked culprit.
> >>
> >> DLC
> >>
> >> ooPIC Tech Support
> >>
> >> -----Original Message-----
> >>
> >> From: "chngedik" <mcgedik@>
> >> Subj: [oopic] need technical support, anyone can help?
> >> Date: Fri Jan 4, 2008 1:57 pm
> >> Size: 1K
> >> To: oopic@yahoogroups.com
> >>
> >> hi guys, ladies;
> >>
> >> i have been working on a graduating project and i decided to use
> >> oopic. few tries later, there was an error occured;
> >> -------------
> >> the fallowing was detected while establishing I2C communications
> >>
> >> the I2C bus clock status reported a logic state 1, when a logic state
> >> of 0 expected this could be caused any of the fallowing;
> >>
> >> A. the programming port is not configured correctly
> >> B. the programming cable was not attached to the PC (it was)
> >> C. the programming cable's I2C clock line is not properly connected
> >> D. the programming cable's I2C clock status line is not properly
> >>
> > connected
> >
> >> E. the I2C clock line is shorted to +5 volts on the oopic or in the
> >>
> > cable.
> >
> >> F. the I2C clock status line is shorted to +5 volts in the cable.
> >> -------------------
> >>
> >> i tried the cable, it was ok. i controlled it's connections. also
> >> remade a new one still the same error.
> >>
> >> i tried the troubleshooting page on the manuel. the oopic passed all
> >> the tests also.
> >>
> >> i tried the 10k on the resistance near to eeprom for capacitances.
> >>
> >> i don't know what to do next. i need some advices.
> >> thanks for your helps.
> >>
> >> cihan.
> >>
> >>
> >>
> >>
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>



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/

Friday, January 4, 2008

Re: [oopic] Re: need technical support, anyone can help?

Remove the Big chip (ooPIC) from the board and try to download. If that
works then the CPU is accessing the EEPROM when the computer is trying
to program it. This can be because the reset line is not pulling low,
which means that your connection to the computer is bad, the CPU is
damaged or the cable is bad. If it still doesn't work with the CPU
pulled out then either the EEPROM is damaged or has a bent pin or again,
the cable is bad. Check to see if the /reset line pulls low, to do this
you'll need a DVM and to use the troubleshooting screen (the one used to
choose a cable) to set various lines to see if they go low/high. If all
the pins toggle as they should and the programmer works when the big
chip is removed then the CPU is bad. If all of the lines toggle and the
EEPROM DOES program when the big chip is removed then the EEPROM is
either bad or has a bent pin.

DLC

chngedik wrote:
> no, it was giving around 8~9 volts
> it was nothing about connections.
> --- In oopic@yahoogroups.com, <dennis.clark@...> wrote:
>
>> Battery? An oft overlooked culprit.
>>
>> DLC
>>
>> ooPIC Tech Support
>>
>> -----Original Message-----
>>
>> From: "chngedik" <mcgedik@...>
>> Subj: [oopic] need technical support, anyone can help?
>> Date: Fri Jan 4, 2008 1:57 pm
>> Size: 1K
>> To: oopic@yahoogroups.com
>>
>> hi guys, ladies;
>>
>> i have been working on a graduating project and i decided to use
>> oopic. few tries later, there was an error occured;
>> -------------
>> the fallowing was detected while establishing I2C communications
>>
>> the I2C bus clock status reported a logic state 1, when a logic state
>> of 0 expected this could be caused any of the fallowing;
>>
>> A. the programming port is not configured correctly
>> B. the programming cable was not attached to the PC (it was)
>> C. the programming cable's I2C clock line is not properly connected
>> D. the programming cable's I2C clock status line is not properly
>>
> connected
>
>> E. the I2C clock line is shorted to +5 volts on the oopic or in the
>>
> cable.
>
>> F. the I2C clock status line is shorted to +5 volts in the cable.
>> -------------------
>>
>> i tried the cable, it was ok. i controlled it's connections. also
>> remade a new one still the same error.
>>
>> i tried the troubleshooting page on the manuel. the oopic passed all
>> the tests also.
>>
>> i tried the 10k on the resistance near to eeprom for capacitances.
>>
>> i don't know what to do next. i need some advices.
>> thanks for your helps.
>>
>> cihan.
>>
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>

--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------


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/