Clreol?
Keith Hilton
Posts: 150
·I am in class at OTC right now, trying Jon Williams suggestion of the following program on a BS-2 and it is telling me CLREOL is a undefined symbol, it also told me hertz was a undefined variable.· I made herts VAR word above the program.· Can't find the term CLREOL in my Basic Stamp Manual.
Sorry, the teacher is gone to Florida and I need help.
Here is what Jon sugested:
Main: Count 0, 1000 hertz
DEBUG, HOME, DEC hertz,CLREOL
GOTO Main
Post Edited By Moderator (Jon Williams) : 12/10/2004 5:55:47 PM GMT
Sorry, the teacher is gone to Florida and I need help.
Here is what Jon sugested:
Main: Count 0, 1000 hertz
DEBUG, HOME, DEC hertz,CLREOL
GOTO Main
Post Edited By Moderator (Jon Williams) : 12/10/2004 5:55:47 PM GMT
Comments
' {$STAMP BS2}
' {$PBASIC 2.5}
You can find CLREOL in the help file which is newer than the manual -- make sure you have the latest version of the BASIC Stamp editor (you can download it from our web site).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
'{$STAMP BS2}
'{$PBASIC 2.5}
hertz VAR word
Main: COUNT 0,1000, hertz
DEBUG HOME,DEC hertz, CLREOL
GOTO Main
I am feeding in a signal from a function generator--sign wave set at 1K hertz.
The 1K hertz signal is sent to a LM324, then to a 74HC14, then to BS2. The DEBUG screen is reading 3000 hertz. Jon, why isn't the DEBUG screen reading 1K hertz?
1. You don't have a common ground.
2. You have 'ringing' on the line.
3. Your sine wave is not zero-referenced.
4. Why send the 1 KHZ signal to an LM324 op amp? For buffering?
5. What does your function generator expect its signal to be terminated by. Typical value 50 ohms.
You can add this to the top of your program to make it work the same with any BASIC Stamp 2 module:
Then you would adjust your COUNT line like this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 12/10/2004 6:30:31 PM GMT
'{$STAMP BS2}
'{$PBASIC 2.5}
hertz VAR word
Main: COUNT 0,1000,hertz
DEBUG HOME, DEC hertz /2, CLREOL
GOTO Main
Don't why it works but it works? I am now going to put the LCD in the program.
Then when I go home ,I am going to hook up my guitar to the same place I hooked up the signal generator. By the way allanlane5, thanks for trying to help. I don't need the LM324 with the signal generator--you are right about this, but I will need it with my guitar, because the signal from a magnetic pickup is weak. Jon wonder why this works?
You really should know why it works before proceeding -- you may be bitten by your ignorance later. Connect a 'scope to see what you're actually getting into the BASIC Stamp for the COUNT function.
Also, can you post your schematic for others to consider?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
SEROUT 8, 16468, [noparse][[/noparse]DEC hertz /2, "HZ"]
GOTO main
Now if I can get get my guitar to work and read out hertz on a picked string, so I can tune to the hertz I want. Got to thinking I was stupid for a while, maybe there is some hope for me Jon.
COUNT 0, 500, hertz
Since your input frequency (to the BASIC Stamp) has been doubled, you only have to sample for half the time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office