bs1 freqout workaround
jasonh
Posts: 5
I have a bs1 and i am trying to use an infrared emitter/receiver pair to determine when an object passes between them.
the problem is that there does not seem to be a FREQOUT command in the BS1 syntax.
Is there an equivalent command or prehaps a way of 'spoofing' a frequency on the BS1 or did I just buy the wrong stamp for my application?
I've tried PULSOUT, SOUND and bringing the pin HIGH but no change in the receiver state yet.
i have 2 IR emitter/receiver pairs and the emiters are powered by a switch on PIN1 heres the code i have.
the problem is that there does not seem to be a FREQOUT command in the BS1 syntax.
Is there an equivalent command or prehaps a way of 'spoofing' a frequency on the BS1 or did I just buy the wrong stamp for my application?
I've tried PULSOUT, SOUND and bringing the pin HIGH but no change in the receiver state yet.
i have 2 IR emitter/receiver pairs and the emiters are powered by a switch on PIN1 heres the code i have.
' {$STAMP BS1} ' {$PBASIC 1.0} '0 = serial '1 = reset switch '2 = rec a '3 = rec b '4 = emm a '5 = emm b '6 = '7 = SYMBOL tempsig1 = W2 SYMBOL tempsig2 = W3 DEBUG "operating" INPUT PIN1 INPUT PIN2 INPUT PIN3 PAUSE 1000 DEBUG CLS main: tempsig1 = PIN2 tempsig2 = PIN3 IF PIN1 = 0 THEN switch ' DEBUG CLS,"off: ", #tempsig1, " " , #tempsig2 GOTO main switch: SOUND 4,(255,10) tempsig1=PIN2 SOUND 5,(255,10) tempsig2=PIN3 DEBUG CLS,"on: ",#tempsig1, " " , #tempsig2 PAUSE 100 GOTO main
Comments
tested the whole rig on the BS2.. works fine.. why is SOUND so different from FREQOUT? what the ?
I guess ill look up using the 555.. any pointers would be helpful and appreciated
jasonh,
SOUND is intended to produce audible sounds, not arbitrary frequencies like 38KHz. Look on pages 190-192 of "IR Remote for the BoeBot" for a typical 555 circuit for 38.5KHz IR production.
problem solved.
I had never used the BS1 in any application before, and to potential purchasers... the functonality of this chip is severely limited compared to the BS2.
word of warning.
Boy have I heard that before!
The limits of any chip is the limits of the programmer, period. Do not think the BS-1 is anything less than a tool that does marvelous things in the right hands. I am sure there is someone out there that could have solved your problem with simple code, a little hardware and some work, at least to them. Don't short change the BS-1. But I agree the BS-2 is a better choice. The BS-1 has been around a long time and will continue for quite awhile longer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D. A. Wreski
...with a little code (all the bs1s memory will allow)
...with a little (secondary) hardware
as for ...
I expect that you were able to port WindowsVista to the BS1, eh? no? .. Hmmm.
Post Edited (jasonh) : 3/15/2008 5:15:49 PM GMT
It's a matter of choosing the right tool for the job or (as you've done) adding a little something extra to the tool to help it do the job.
For that matter, I would start with something like the BS2p or BS2px for a Stamp project because of the extra statements not
in the BS2/BS2e/BS2sx and the extra speed and memory. If the 3.3V I/O isn't more work than it saves, I'd actually start with a
Propeller Protoboard since it's very powerful and pretty cheap, particularly since I already have several PropClips it's only $20 a pop.