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.

Saturday, December 22, 2007

[oopic] SRF02 on an OOpic-R

Hi Folks,

Am new here ( and to robotics ) so please bear with me :)

I recently got an OOPic-R board and have so far had no problems with
a few small programs ( switching LED's / buzzing / running servos and
running a Motor controller ) But I am now trying to connect an SRF02
Ultasonic range finder ( http://www.robot-
electronics.co.uk/htm/srf02techI2C.htm ).

The simple program I have is :

Dim Sonar As New oI2CM 'Sonar object
Dim Servo As New oServo 'Servo object
Dim Range As New oByte ' Range variable

Sub Main()
ooPIC.Delay = 500 ' 5 sec delay before start

'~~~~~~~~~~~~ Set Up Sonar~~~~~~~~~~~~~~~~
Sonar.Node = 112 ' Decimal of Hex address 0xE0 shifted by 1
Sonar.Mode = cv10Bit ' I2C mode as 10-Bit addressing.
Sonar.Width = cv8Bit ' 1 byte wide transfer
Sonar.NoInc = 1 ' Don't increment


'~~~~~~~~~~~~~ Set up Servo ~~~~~~~~~~~~~~~~
Servo.IOLine = 31 ' Use line 31
Servo.Adjust = 28 ' Center
Servo.Operate =cvTrue ' Start servo

Do ' Continuous loop
Sonar.Location = 0 ' Command register
Sonar = 81 ' Set ranging to cm
ooPIC.Delay = 7 ' Wait to give sonar time
Sonar.Location = 2 ' Just get high Byte
Range = Sonar ' Get Range
Servo = Range ' Move servo
ooPIC.Delay = 50 ' Wait 500ms
Loop

End Sub

Did this just to try and read the high byte and move a servo to show
I'm getting a signal every half second.

When this runs the servo moves slightly forward and back at half
second intervals but the sonar does not seem to be firing ( no led
blink, only the long blink on power up ).

I'm sure this will be the first of many questions :)

Wishing you all the best.

Richard


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/

Re: [oopic] Bluetooth with OOPIC

If you have BT already in your main computer then check out:
www.sparkfun.com and look at the BlueSmirf modems. I've ordered one of
these and I'm going to see how they work. If you don't have any BT
equipment yet then the easiest way to go is using the Maxstream Zigbee
stuff, it is a LOT easier to network than the complex BT pairing
process. Dan at www.oricomtech.com has some ooPIC custom XBee stuff
that is easy to use.

DLC

aravind_2917 wrote:
> hello,
>
> Iam new to robotics and microcontrollers..
> Iam trying to build a small servo motor controlled car which has an
> OOPIC-R board. I want to control this car from a bluetooth enabled
> mobile. Please tell me how to go about it.
>
> The actual plan is : A mobile will recieve commands from the
> internet,through GPRS.Mobile will transmit those commands to oopic
> which will move the car accordingly.
> Is it possible?...what problems may arise?...what are the things that
> ill need?...i already have an OOPIC-R board.
>
> This is what i have in mind,,
> Ill use a serial port bluetooth dongle..(sparkfun electronics firefly)
> which supports serial profile.Ill send serial data from mobile to this
> serial bluetooth dongle attached to oopic...Is it possible?..or is
> there a better way?
>
>
>
>
>
> 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, December 21, 2007

[oopic] Re: New to OOPIC Event Programming..pls help..

And it is written for V5 of the IDE/compiler...

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> This code is known to work:
>
> Dim LED as new oDIO1
> Dim Button as new oDIO1
> Dim Wire as new oWire
> Dim Evt as new oEvent
>
> Sub Main()
>
> OOPic.Delay = 500 ' always delay at startup
>
> OOPIC.Node = 5 ' for debugging
> OOPIC.PullUp = cvOn ' pull up IOLines 8..15 (inputs)
>
> LED.IOLine = 7
> LED.Direction = cvOutput
>
> Button.IOLine = 8 ' use IOLines 8..15 as inputs (pull-ups)
> Button.Direction = cvInput
>
> Wire.Input.Link(Button)
> Wire.Output.Link(Evt.Operate)
> Wire.Operate = cvTrue
>
> end sub
>
> sub Evt_Code()
>
> LED = cvOn
> OOPic.Delay = 100
> LED = cvOff
>
> End Sub
>
> It has 3 drawbacks: it is for the S board, it is written in Basic
and
> it doesn't use a tone.
>
> It has only 1 positive attribute: it works.
>
> Richard
>



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: New to OOPIC Event Programming..pls help..

This code is known to work:

Dim LED as new oDIO1
Dim Button as new oDIO1
Dim Wire as new oWire
Dim Evt as new oEvent

Sub Main()

OOPic.Delay = 500 ' always delay at startup

OOPIC.Node = 5 ' for debugging
OOPIC.PullUp = cvOn ' pull up IOLines 8..15 (inputs)

LED.IOLine = 7
LED.Direction = cvOutput

Button.IOLine = 8 ' use IOLines 8..15 as inputs (pull-ups)
Button.Direction = cvInput

Wire.Input.Link(Button)
Wire.Output.Link(Evt.Operate)
Wire.Operate = cvTrue

end sub

sub Evt_Code()

LED = cvOn
OOPic.Delay = 100
LED = cvOff

End Sub

It has 3 drawbacks: it is for the S board, it is written in Basic and
it doesn't use a tone.

It has only 1 positive attribute: it works.

Richard



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] free to a good home

I have 2 oopic boards. Both are version B.2.2+. I will ship them to a
good home at my expense. Preferable someone using them in an
educational instiution. US only.

Loved them but have a new love now.

If interested drop me an email at arvin dot(yep an extra dot there)
evans at gmail dot com. I taught for 26 years so know the $ limits for
educators.

Both should be working and in good shape. Bought the second one when I
thought the pwm of the first wasn't working but both seem to work. YMMV!

Arvin

--
Blog: http://ar5in.tumblr.com/
Site: http://www.freewebs.com/adub/


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] Bluetooth with OOPIC

hello,

Iam new to robotics and microcontrollers..
Iam trying to build a small servo motor controlled car which has an
OOPIC-R board. I want to control this car from a bluetooth enabled
mobile. Please tell me how to go about it.

The actual plan is : A mobile will recieve commands from the
internet,through GPRS.Mobile will transmit those commands to oopic
which will move the car accordingly.
Is it possible?...what problems may arise?...what are the things that
ill need?...i already have an OOPIC-R board.

This is what i have in mind,,
Ill use a serial port bluetooth dongle..(sparkfun electronics firefly)
which supports serial profile.Ill send serial data from mobile to this
serial bluetooth dongle attached to oopic...Is it possible?..or is
there a better way?



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: New to OOPIC Event Programming..pls help..

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> The oEvent object only triggers on a low-to-high transition, so
toggle
> isn't what I would use for the button. Try one that just acts like
a
> momentary contact. When you trigger the event you turn on the
sound,
> but you never turn it off, that isn't likely to do anything useful
> either, you should just "blip" it in the event handler. Another
idea is
> to set e.Operate = 0 initially to make sure of its initial state.
>
> DLC
>
> aravind_2917 wrote:
>
> >hello,
> >Am new to microcontrollers..i have got an oopic R board with c1.1+
> >firmware.
> >Am trying to write an event driven program. I want speaker to make
a
> >sound when a button is pressed...this is what i tried:
> >
> >1. oEvent e=New oEvent;
> >2. oButton b=New oButton;
> >3. oWire w=New oWire;
> >4. oSpeaker sp=New oSpeaker;
> >5.
> >6. Void main(Void){
> >7. b.IOLine=7;//button already on OOPIC-R
> >8. b.Mode=1; //toggle mode
> >9. w.Input.Link(b.Position);
> >10. w.Output.Link(e.Operate);
> >11. w.Operate=cvTrue;
> >12. }
> >13. Void e_Code(Void){
> >14. sp.Operate=1;
> >15. }
> >
> >There's no compile error,but,Its not working..
> >but when i change line 10 to "w.Input.Link(sp.Operate)" its working
> >what's wrong ? pls help me..!
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------

Okay ive tried it but no use...can you please give me the program...i
just want to check whether events are working or not..i dont have any
external hardware...i only have oopic-r board...leds and push buttons
on IOLines 5 6 and 7...i have to show somebody how events work...



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/