BS2 functions - freqout
shmow
Posts: 109
I have the propeller kit (PE), and I've done the labs.
When I try to use the BS2 functions object for the freqout command there is no response.
I've written two simple programs:
·- one that turns on an LED when a button is press (without BS2 object written in)
·- other that does the same as above as well as send a frequency signal to a piezo (with BS2 object written in)
When I run the second program there is no sound from piezo and the LED does not turn on.
The only way to get the LED to turn on (in the second program) is if I comment out any reference to the BS2 function.
I've tested the piezo separately and added a transistor to the piezo to apply 5V instead of 3.3V.
Also, I made sure the object file is in the same folder as the main program and the directory has both files referenced.
After narrowing the problem down (as far as my expertise would allow - very limited) the program would stop working if I included the BS2.start (31,30) method - see attached files.
Any suggestions would help.
Thanks,
Shmow.
When I try to use the BS2 functions object for the freqout command there is no response.
I've written two simple programs:
·- one that turns on an LED when a button is press (without BS2 object written in)
·- other that does the same as above as well as send a frequency signal to a piezo (with BS2 object written in)
When I run the second program there is no sound from piezo and the LED does not turn on.
The only way to get the LED to turn on (in the second program) is if I comment out any reference to the BS2 function.
I've tested the piezo separately and added a transistor to the piezo to apply 5V instead of 3.3V.
Also, I made sure the object file is in the same folder as the main program and the directory has both files referenced.
After narrowing the problem down (as far as my expertise would allow - very limited) the program would stop working if I included the BS2.start (31,30) method - see attached files.
Any suggestions would help.
Thanks,
Shmow.
Comments
- Your program is small enough you could have copied it into your posting (using [noparse][[/noparse] code ] ...[noparse][[/noparse] /code ] of course!) This will generally speed up responses...
-Please don't use spaces in your file names. I decided once to no longer look into files that contain blanks in their names....
But no rule without exception...
- How should the Propeller know that you want BTN_LED executed? It just executes the FIRST routine and then stops.
Okay, I changed things according to your advice - thanks.·
And I got it to work...yeah!
Here's the revised program and this time with just ONE public method (one section of code).
I have a pretty good handle on the·stamp but with the prop & spin - I'm taking baby steps.
Thanks for your help.
Cheers,
Shmow·