Case Statement
MSDTech
Posts: 342
I am building a Haloween display that will be operated by a remote control. The problem is the case statement that is used to determine the action when a specific code is received from the remote. If the case statement is present, I get wildly varing reads of the remote, comment it out and everything works fine.
What is going on??
What is going on??
Comments
You should archive your code. IN the main-menu of the propeller-tool is an option archive project.
This will put all files needed to compile your code into a zip-archive.
Without having the complete code I can only do a guessing.
Did you try it with just one case-value active?
adding the second case-value testing again?
adding the third case-value testing again?
you have to narrow down the problem. When does the problem exactly ocure?
Your method Play_Corpse starts a new cog which object starts how many cogs?
are you sure that you don't run out of cogs?
can't check this because the other objects are not included in your attachement
best regards
Stefan
I've attached the full archive.
thanks for the full code. you wrote it as a question.
You are the one who can test it. I haven't a setup including a SD-card and your soundfiles.
Try one case-value at a time all others commented out
Then add one after the other. Exclude headright only - all others included.
How fast is the repeat function of your remote control?
best regards
Stefan
if it is working now this is just another hint that something strange is going on.
the BS2-method PulseIn calls PULSIN_Clk uses several waitpne and waitpeq-commands. This means the cog is stopped COMPLETELY until the matching-condition is true.
see note in the BS2_functions.spin-file
Note: Absence of pulse can cause cog lockup if watchdog is not used - See distributed example
So it might be that your code gets locked up first and then if the repeating function of the IR-remote starts the rest of the bits is filled up.
And then you get strange readings.
Did you check ALL combinations of IR-commands?
best regards
Stefan