PDA

View Full Version : Need help for Gripper + IR and the meaning



CJW
04-07-2010, 10:27 PM
Hi,

I would like to know where my mistake is as I felt something missing. Now i figure out how the boe-bot move and so on. Below is my program that I wrote and i took the video. Can I also need to know what is the meaning of IN6 = 0, IN3 = 0 and FREQOUT? The meaning of PULSOUT is like use for the duration argument and the meaning of GOSUB means perform jump. Am I right for the meaning. Any solution to guide me or is there any link for me to look for the meaning. If you unable to open my document please inform me. thank you

This is also edited but still cannot move.

' BOEGripperIF.bs2 SIMPLE BOE-Bot Gripper Test Using Infra Red Detection

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "Program Running!"



irDetectLeft VAR Bit ' Variable Declarations..
irDetectRight VAR Bit
pulseLeft VAR Word
pulseRight VAR Word
pulseGrip VAR Word

DEBUG "Testing piezospeaker..."
FREQOUT 4, 2000, 3000 ' Signal program start/reset..

DEBUG CLS,
"IR DETECTORS", CR,
"Left Right", CR


DO ' Main Routine..

FREQOUT 8, 1, 38500 ' Check IR Detectors..
irDetectLeft = IN9

FREQOUT 2, 1, 38500
irDetectRight = IN0
' Gripper Action..
IF (irDetectLeft = 1) AND (irDetectRight = 1) THEN 'Gripper IF..
HIGH 10
HIGH 1

pulseGrip = 1000 ' Close Gripper


ELSE
LOW 10
LOW 1
pulseGrip = 500 ' Open Gripper

ENDIF


DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight

PAUSE 20 '(we PAUSE otherwise the servo hums,
'gotta give the program time to run.)

PULSOUT 13,pulseLeft ' Apply the pulse..
PULSOUT 12,pulseRight
PULSOUT 14,pulseGrip
LOOP

James

Post Edited (CJW) : 4/7/2010 3:00:39 PM GMT

bill190
04-08-2010, 12:32 AM
On the stamp editor, click on the word Help at the top.

Then click on BASIC Stamp Help.

Then you can search for a word or look through the·contents or Language Reference. Then this will explain what each command is for and give examples.

FYI - IN0 means·pin 0. IN1 means pin 1. IN15 means pin 15, etc.

You would use that to see if a certain pin was a 1 or 0.

Search for the command INPUT

There are pins on the stamp which can be used for input or output.

CJW
04-08-2010, 12:15 PM
Hi,

You mean where is it. can u send me the link please.

James

Franklin
04-08-2010, 12:25 PM
James, it is in the help files that come with the editor you use to compile your code. Follow the instructions above provided by bill190

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

CJW
04-11-2010, 09:44 PM
k.. thx