I want to magnetize a coil and demagnetize a coil.
keerthu
Posts: 4
I want to magnetize the coil and demagnetize the coil.
I know how to do the circuit connections.
I use one really to control it. Relay will work as a switch.
The problem is I have to control it by RC ((Futaba 6 Ex-A RC controller has 6 channels.
Its operating frequency is 72 MHz. it has R136F receiver))
·
I am trying to do it by Basic stamp program. (BS2)
L I can’t do it...
Please help me...
·
·
My program
Setup:
·
INPUT·· 3
OUTPUT· 10
·
·
VAL3··· VAR···· Word
·
·
check_status:
·
PULSIN 3,1, VAL3
DEBUG DEC4 VAL3,· CR
·
IF (VAL3>950) THEN magnetize·· 'CH4
IF (VAL3<950) THEN demagnetize
·
GOTO Stop
·
Stop:
LOW··· 10
·
magnetize:
HIGH·· 10
GOTO· check_status
·
demagnetize:
·
LOW· 10
·
GOTO· check_status
·
·
·
Post Edited By Moderator (Chris Savage (Parallax)) : 9/4/2007 4:00:36 PM GMT
I know how to do the circuit connections.
I use one really to control it. Relay will work as a switch.
The problem is I have to control it by RC ((Futaba 6 Ex-A RC controller has 6 channels.
Its operating frequency is 72 MHz. it has R136F receiver))
·
I am trying to do it by Basic stamp program. (BS2)
L I can’t do it...
Please help me...
·
·
My program
Setup:
·
INPUT·· 3
OUTPUT· 10
·
·
VAL3··· VAR···· Word
·
·
check_status:
·
PULSIN 3,1, VAL3
DEBUG DEC4 VAL3,· CR
·
IF (VAL3>950) THEN magnetize·· 'CH4
IF (VAL3<950) THEN demagnetize
·
GOTO Stop
·
Stop:
LOW··· 10
·
magnetize:
HIGH·· 10
GOTO· check_status
·
demagnetize:
·
LOW· 10
·
GOTO· check_status
·
·
·
Post Edited By Moderator (Chris Savage (Parallax)) : 9/4/2007 4:00:36 PM GMT
Comments
One case that won't work the way it sounds is Stop. There's nothing after the LOW to stop anything. How about a GOTO Stop?
I don't know about the numbers ... A pulse VAL3 of 950 corresponds to a pulse width of 2 * 950 us = 1900us or 1.9ms.
Is that what you want?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (D Faust) : 9/1/2007 11:50:43 AM GMT
Is that what you want? //
Yea MR. Mike your right.
But I used only numbers in my other program. It is working.
So I don’t think the number is the problem here.
There is some thing else.
May be I will remove stop command and I will change the value to 750, 850
And I will try.
PULSIN 3, 1, VAL3
DEBUG DEC4 VAL3, CR
Using this coding the pulse width value was determined for each channel for their different positions
Thanks for the ideas D Faust and mike.
If you're asking your question about the following program coding, it sure is PBASIC:
PULSIN 3, 1, VAL3
DEBUG DEC4 VAL3, CR
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Setup:
INPUT·· 3
OUTPUT· 10
VAL3··· VAR···· Word
·
·
DO
· PULSIN 3,1, VAL3
· DEBUG DEC4 VAL3,· CR
· IF (VAL3>950) THEN
··· HIGH 10
··ELSE
··· LOW 10
· ENDIF
· LOW· 10
LOOP
·
Matbe this is just what I'm used to seeing, but the other program didn't even have any GOSUB arguments, which I thought you needed to use to run subroutines...
·
Post Edited (Lithium_fun!) : 9/3/2007 3:51:58 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yes it is but you can not use this way you· have it that will not compile
here is an example of how to use it
Main:
· LOW 0································ ' turn LED on
· STOP································· ' stop program
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 9/5/2007 2:07:52 AM GMT