returning form an object back to the main program stack
KeyBoard
Posts: 22
hello all,
I am in a bit of a pickle my current project of a diy remote to communicate with my robot is going well except for an error I came across that I can't solve. I have a main program(RF_DEMO_TX) that calls and object in the program(RF_main) the object determines if the switch is on or off and transmits the signal, but now I need to get back from the object to the main program so that I can check the rest of the buttons and switch's I have tried return but it does not work.
any suggestions
kind regards
I am in a bit of a pickle my current project of a diy remote to communicate with my robot is going well except for an error I came across that I can't solve. I have a main program(RF_DEMO_TX) that calls and object in the program(RF_main) the object determines if the switch is on or off and transmits the signal, but now I need to get back from the object to the main program so that I can check the rest of the buttons and switch's I have tried return but it does not work.
any suggestions
kind regards
Comments
You need to post your code ... as an attachment to a reply ... use the Go Advanced button and use the Attachment Manager that shows up to upload your source files.
the code is attached I need the program to start in the main method of the RF_Demo_tx file after it has check the right_out switch it needs to "return " to the stack to check the right_in switch and then repeat forever
regards,
RF_Demo_Tx.spinRF_Main.spin
Some comments ... Your indenting is sloppy. Things at the same nesting level need to be indented the same amounts.
... You don't call the initialization routine for the BS2_Functions object before you use the other methods in that object. The HIGH() and LOW() methods don't require this, but you should do it.
... There are other objects that you either don't use or use only in methods that you're not calling yet. It's best to only declare those that you're using.
regards
P.S will a video help
But not all the objects are attached. You can archive your program in the Propeller Tool by selecting File\Archive "RF_Demo_Tx"\Project....
What does that mean? What were you expecting it to do? What does it do you weren't expecting?
on the remote I have 6 pots, 4 toggle switchs, a lcd, a 4x4 matrix keypad and the transmitter uses 8 pins.
I need the program to continually check the state of the inputs and if they change the transmit the signal
That said, depending on how you print the result it may not show what I'm after. Any chance that you could place some code after each function call indicating that we have been there (as an extreme case you could use the reboot command).
Shift registers are pretty easy to use and there are both input and output versions.
I thought I was being clever by reducing the number of I/O pins required by my 4x4 keypad to four pins but I was soon shown there were better ways to read a keypad with fewer pins. There's even a 1-pin keypad object.
does anyone have example code and wiring for the shift registers(74HC165 Parallel to Serial Shift Register, 74HC595 Serial to Parallal Shift Register) that parallax sells I think I would be better that for my project if I can send a string from the transmitter though the shift registers and tx chip to the rx chip and though the shift register again and let the rx prop receive a string. that could work or if anyone has ideas on doing the same thing with code because I don't have much space left on my board.
kind regard,