Confusion!
Iguanaman
Posts: 32
in Propeller 1
Am trying to get a program running from the book "programming and customizing the multicore propeller micro."
The program is on page 140 " Test Sample RCTIME.spin ".
Here be code.
'' Test Simple RCTIME.spin
CON
_clkfreq = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
rc : "RCTime"
pst : "Parallax Serial Terminal"
PUB Go | tDecay
pst.Start(115200)
repeat
waitcnt(clkfreq/10 + cnt)
rc.time(18, 1, @tDecay)
pst.Str(String(pst#CE, pst#HM, "tDecay = "))
pst.Dec(tDecay)
When I run the program I get a " Expected a subroutine name?"
Then it highlights " rc.time(18, 1, @tDecay) "
I tried to fix it but me not so smart!!!! Thank you for any help that anyone can give. 13 feb 2019(wen).
The program is on page 140 " Test Sample RCTIME.spin ".
Here be code.
'' Test Simple RCTIME.spin
CON
_clkfreq = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
rc : "RCTime"
pst : "Parallax Serial Terminal"
PUB Go | tDecay
pst.Start(115200)
repeat
waitcnt(clkfreq/10 + cnt)
rc.time(18, 1, @tDecay)
pst.Str(String(pst#CE, pst#HM, "tDecay = "))
pst.Dec(tDecay)
When I run the program I get a " Expected a subroutine name?"
Then it highlights " rc.time(18, 1, @tDecay) "
I tried to fix it but me not so smart!!!! Thank you for any help that anyone can give. 13 feb 2019(wen).
Comments
Thanks,
-Phil
I don't where my copy of the book is but try using the files from here.
ftp://ftp.propeller-chip.com/PCMProp/Chapter_04/Source/
RC Time.spin
Test Simple RCTIME.spin
in this code there is no indentation to see. And in this case: repeat just runs forever as an empty loop.
So please post your code again using the code tag.
(Mark the code area and click the C button in the top area of this editor
@lardom, the RCTIME method may be run as either foreground or background.
2) In the instruction "rc.time(18, 1, @tDecay)" there is no method named "time" in the RCTIME object.