RCTime
Newzed
Posts: 2,503
Jon wrote a program for RCTime which I downloaded from the Parallax site.· He·writes in part:
PUB start(pin, state, rcvalueaddress) : okay···
I understand that pin would be replaced by 0, 1,2, etc., and that state would be replaced by 1 or 0.· What is "rcvalueaddress"?· Is this an EEPROM location that would hold the value of the RC time?· How do I read it?· Suppose I wanted to send the value to Hyperterminal using the Tx line - how would I do that?
Sid
PUB start(pin, state, rcvalueaddress) : okay···
I understand that pin would be replaced by 0, 1,2, etc., and that state would be replaced by 1 or 0.· What is "rcvalueaddress"?· Is this an EEPROM location that would hold the value of the RC time?· How do I read it?· Suppose I wanted to send the value to Hyperterminal using the Tx line - how would I do that?
Sid
Comments
Use the @ (address of) operator to pass the address of a variable:
· rc.start(0, 1, @potVal)
This assumes you've declared an object of rctime called rc, and that you've declared a variable (a long) called potVal.
My June column in Nuts & Volts covers the updated version of the rctime object and how to use it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I am having a very difficult time grasping SPIN - guess I'm getting to old to absorb new stuff easily.· I'll probably have to be hand-fed every step of the way.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
PUB str(potvalue)
Would it automatically display potvalue in Hyper?
How would I write it if I wanted to display:
Pin 0 - 1234 - Pass
I am really quite brain-dead when it come to SPIN.
Sid
PUB tx("Q")
or
PUB dec(5)
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10