Need help with my Propeller Project
jknightandkarr
Posts: 234
in Propeller 1
http://www.titaniceng.altervista.org/DTMFLatch.zip
First of all here is the program. I noticed that its got massive delays, I know some are in the DTMF.spin, which I can easily adjust, but there seams to be more then that. Here is how it's supposed to run on my PPDB.
1)I/O 0..9 get looked at and place a word sized variable called ButtonState.
2)I/O 10-19 get looked at and placed into 10 Byte sized variables. Set1 to Set10
3)After these variables are done, I used Case to check the button state for this: %00000011_11111110 to %00000001_11111111. 10 diff binary combinations. Looking to see what button is pressed. The following info is sent to "Pri Button" with the following variables: Pin, LOoO, State. Pin being to represent what button has been pressed 0 to 9, LOoO aka Latch On or OFF? (used with Set1 - Set10 Variables. 0:= Momentary System & 1:= On or Off. I used the switches on the PPDB for this), State being the ButtonState Binary variable data. I used 2 PPDB's for the 10 buttons and 10 switches, just connected them togeather with the 5v & Gnd rails.
4) From there, the Word output variable called RelayState, I think, is updated %0000_00xx_xxxx_xxxx the x being each output, sent to 74hc595 shift register. I added waitpeq to wait till all the buttons had been released
4A) Momentary: Output on, plays 1 of 16 random DTMF tones, waits for all button(s) release then relay is turned off again.
4B) On or Off: Same as 4A but uses Case command to check if relay is currently On, if on then turns it out.
5)Repeats from 1
I know I got errors, but not sure where...
Joe
I saw on PRI Button in the Case area I had the buttonstate data in where I think 1 or 0 should been. Haven't tried the program. Already put everything away after being frustrated.... Lol
First of all here is the program. I noticed that its got massive delays, I know some are in the DTMF.spin, which I can easily adjust, but there seams to be more then that. Here is how it's supposed to run on my PPDB.
1)I/O 0..9 get looked at and place a word sized variable called ButtonState.
2)I/O 10-19 get looked at and placed into 10 Byte sized variables. Set1 to Set10
3)After these variables are done, I used Case to check the button state for this: %00000011_11111110 to %00000001_11111111. 10 diff binary combinations. Looking to see what button is pressed. The following info is sent to "Pri Button" with the following variables: Pin, LOoO, State. Pin being to represent what button has been pressed 0 to 9, LOoO aka Latch On or OFF? (used with Set1 - Set10 Variables. 0:= Momentary System & 1:= On or Off. I used the switches on the PPDB for this), State being the ButtonState Binary variable data. I used 2 PPDB's for the 10 buttons and 10 switches, just connected them togeather with the 5v & Gnd rails.
4) From there, the Word output variable called RelayState, I think, is updated %0000_00xx_xxxx_xxxx the x being each output, sent to 74hc595 shift register. I added waitpeq to wait till all the buttons had been released
4A) Momentary: Output on, plays 1 of 16 random DTMF tones, waits for all button(s) release then relay is turned off again.
4B) On or Off: Same as 4A but uses Case command to check if relay is currently On, if on then turns it out.
5)Repeats from 1
I know I got errors, but not sure where...
Joe
I saw on PRI Button in the Case area I had the buttonstate data in where I think 1 or 0 should been. Haven't tried the program. Already put everything away after being frustrated.... Lol
Comments
Joe
I'm thinking that you received no response is that No One knows what you are attempting
to ask.
It looks like you are asking about something using spin language.
I am absolutely no expert here, but there are many people who chime in
whenever they see that that they can help.
The link you attached to the top of your post leads me to a site I'm hesitant to go to.
..
I believe that if you think about how your questions are set up and reword them.
Any of the forum guys that can contribute, will contribute.
..
That's my 2 cents worth.
I hope it helps you in some manner.
http://www.titaniceng.altervista.org/DTMFLatch.zip
I downloaded your code and took a look at it along with the explanation in your first post, and am still a little unsure of what you are trying to do. It looks like the following to me:
You have 10 momentary contact pushbuttons and 10 relays. When you press a button you want a random DTFM tone to play, and to turn the corresponding relay on if it is off, and off if it is on. That is button 1 toggles relay 1, button 2 relay 2, etc.
Is this correct?
PS- I am also guessing that you are using the 10 switches to emulate the relay contact being open or closed. Is that so?
Yes, 10 buttons, and 10 relays. The switches are supposed to be a settings.
I/O: 0..9 := The 10 buttons. 'All momentary
I/O 10..19 := 10 switches 'Output settings 1:= On or Off latching, 0:= Momentary
-I/O 10 setting for button 0.. I/O 19 setting for button 9
Here's the layout of what is supposed to happen:
1) Read the button inputs and 10 setting switches, store in variables.
2) If button is presses it plays a random, 1 of 16 possible DTMF tones for a moment then checks the corisponding setting variable and then turns on the relay. Otherwise loop at step 1 till a button is pressed.
3) If setting for button being pressed is 0, then turn same relay back off. If setting is 1:= Then it's toggle the relay from Off to On or On to Off and hold state till button pressed again.
4) Go back to step 1 and repeat endlessly.
I originally was going to use 10 outputs, but when my original design wasn't going to work, I decided to save wires and use a shift out register to take the place of the 10 I/O pins. I got the tones, but there is a unwanted delay, and my shift register doesn't seam to be working, not sure if bad register or its the coding.
JonnyMac, I will try your code and see if I can get it to work for me. I am also going to try another way of creating my sounds.
kwinn, will try yours as well.
Thanks for the help everyone.
Joe